Skip to content

Commit 315b148

Browse files
committed
make the workflow look more like the example
at https://github.com/docker/build-push-action#git-context
1 parent 6808a63 commit 315b148

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

.github/workflows/container-build.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
name: Build and Push Docker Image
2+
23
on:
34
push:
45
branches:
56
- master
7+
68
jobs:
79
build-and-push:
810
strategy:
@@ -13,23 +15,20 @@ jobs:
1315
# - latest
1416
runs-on: ubuntu-latest
1517
steps:
18+
- name: Set up Docker Buildx
19+
uses: docker/setup-buildx-action@v3
1620
- name: Login to GHCR
1721
uses: docker/login-action@v3
1822
with:
1923
registry: ghcr.io
20-
username: DFHack-Urist
24+
username: ${{ github.actor }}
2125
password: ${{ secrets.GITHUB_TOKEN }}
22-
# From https://github.com/docker/build-push-action#git-context
23-
# Setting up Docker Buildx with docker-container driver is required
24-
# at the moment to be able to use a subdirectory with Git context
25-
- name: Set up Docker Buildx
26-
uses: docker/setup-buildx-action@v3
2726
- name: Build and push
2827
uses: docker/build-push-action@v6
2928
with:
3029
context: "{{defaultContext}}:${{ matrix.IMAGE_TAG }}"
3130
push: true
32-
tags: ghcr.io/${{ env.GHCR_NAMESPACE }}/${{ env.IMAGE_NAME }}:${{ matrix.IMAGE_TAG }}
31+
tags: ${{ env.GHCR_NAMESPACE }}/${{ env.IMAGE_NAME }}:${{ matrix.IMAGE_TAG }}
3332
env:
3433
GHCR_NAMESPACE: dfhack
3534
IMAGE_NAME: build-env

0 commit comments

Comments
 (0)