Skip to content

Commit d506055

Browse files
authored
Update Docker build workflow for GitHub Actions
1 parent 542552a commit d506055

1 file changed

Lines changed: 25 additions & 18 deletions

File tree

.github/workflows/docker-build.yml

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,31 @@
11
name: build
22
on:
3-
push:
3+
workflow_dispatch:
44
jobs:
55
build:
66
runs-on: ubuntu-latest
77
steps:
8-
- uses: actions/checkout@v2
9-
with:
10-
fetch-depth: 0
11-
- uses: docker/login-action@v1
12-
with:
13-
registry: ghcr.io
14-
username: ${{ github.repository_owner }}
15-
password: ${{ secrets.GITHUB_TOKEN }}
16-
- uses: docker/login-action@v1
17-
if: 0
18-
with:
19-
username: voidic
20-
password: ${{ secrets.DOCKER_HUB_TOKEN }}
21-
- uses: docker/setup-qemu-action@v1
22-
- uses: docker/setup-buildx-action@v1
23-
- name: Build the Docker image
24-
run: docker buildx build -t ghcr.io/${{ github.repository_owner }}/strfry:latest --platform linux/amd64 --platform linux/arm64 --push .
8+
# Step 1: Checkout the repository code
9+
- name: Checkout repository
10+
uses: actions/checkout@v3
11+
12+
# Step 2: Set up Docker Buildx (for multi-platform builds if needed)
13+
- name: Set up Docker Buildx
14+
uses: docker/setup-buildx-action@v2
15+
16+
# Step 3: Log in to GitHub Container Registry
17+
- name: Log in to GHCR
18+
uses: docker/login-action@v2
19+
with:
20+
username: ${{ github.actor }}
21+
password: ${{ secrets.GITHUB_TOKEN }}
22+
23+
# Step 4: Build the Docker image
24+
- name: Build Docker image
25+
run: |
26+
docker build -t ghcr.io/${{ github.repository_owner }}/strfry:latest .
27+
28+
# Step 5: Push the Docker image to GHCR
29+
- name: Push Docker image to GHCR
30+
run: |
31+
docker push ghcr.io/${{ github.repository_owner }}/strfry:latest

0 commit comments

Comments
 (0)