Skip to content
This repository was archived by the owner on Jun 12, 2025. It is now read-only.

Commit 2a554e9

Browse files
committed
add deploy workflow
1 parent 0ad4135 commit 2a554e9

File tree

2 files changed

+40
-39
lines changed

2 files changed

+40
-39
lines changed

.github/workflows/deploy.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Build and Push to GHCR
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
build-and-push:
9+
runs-on: ubuntu-latest
10+
11+
permissions:
12+
contents: read
13+
packages: write
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Log in to GitHub Container Registry
20+
uses: docker/login-action@v3
21+
with:
22+
registry: ghcr.io
23+
username: ${{ github.actor }}
24+
password: ${{ secrets.GITHUB_TOKEN }}
25+
26+
- name: Set image name
27+
id: meta
28+
run: |
29+
IMAGE_NAME=ghcr.io/${{ github.repository_owner }}/$(basename ${{ github.repository }})
30+
IMAGE_NAME=$(echo "$IMAGE_NAME" | tr '[:upper:]' '[:lower:]')
31+
echo "image_name=$IMAGE_NAME" >> $GITHUB_OUTPUT
32+
33+
- name: Build and push Docker image
34+
uses: docker/build-push-action@v5
35+
with:
36+
context: .
37+
push: true
38+
tags: |
39+
${{ steps.meta.outputs.image_name }}:latest
40+
${{ steps.meta.outputs.image_name }}:${{ github.sha }}

.github/workflows/test_job.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

0 commit comments

Comments
 (0)