Skip to content

Commit c26ded2

Browse files
committed
Replace deploy workflow with image publishing
1 parent fbaa4ae commit c26ded2

2 files changed

Lines changed: 40 additions & 40 deletions

File tree

‎.github/workflows/deploy.yml‎

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

0 commit comments

Comments
 (0)