Skip to content

Commit 9f9c724

Browse files
committed
fix(ci): update docker workflow to use the new context required by v6
1 parent 329a905 commit 9f9c724

1 file changed

Lines changed: 31 additions & 22 deletions

File tree

.github/workflows/docker.yml

Lines changed: 31 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -12,39 +12,48 @@ jobs:
1212

1313
steps:
1414
- uses: actions/checkout@v4
15-
if: ${{ contains(github.event.head_commit.message, '[skip ci]') != true }}
1615

17-
- name: Build and push stable Docker image
18-
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
16+
- name: Login to Docker Hub
17+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
1918
with:
2019
username: ${{ secrets.DOCKER_USERNAME }}
2120
password: ${{ secrets.DOCKER_PASSWORD }}
22-
repository: arkscript/stable
23-
dockerfile: Dockerfile
24-
# tag with the git commit SHA
25-
tag_with_sha: true
26-
tags: latest
21+
22+
- name: Declare some variables
23+
shell: bash
24+
run: |
25+
echo "sha_short=$(git rev-parse --short "$GITHUB_SHA")" >> "$GITHUB_ENV"
26+
echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> "$GITHUB_ENV"
27+
28+
- name: Set up QEMU
29+
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
30+
31+
- name: Set up Docker Buildx
32+
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
33+
34+
- name: Build and push stable Docker image
35+
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
36+
with:
37+
file: Dockerfile
38+
tags: arkscript/stable:latest,arkscript/stable:${{ env.sha_short }}
2739
# push the image only if the event that kicked off the workflow was a push of a git tah
2840
push: ${{ startsWith(github.ref, 'refs/tags/') }}
41+
# keep .git repository
42+
context: .
2943

3044
- name: Build and push nightly Docker image
3145
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
3246
with:
33-
username: ${{ secrets.DOCKER_USERNAME }}
34-
password: ${{ secrets.DOCKER_PASSWORD }}
35-
repository: arkscript/nightly
36-
dockerfile: Dockerfile
37-
# tag with the git commit SHA
38-
tag_with_sha: true
39-
tags: latest
47+
file: Dockerfile
48+
tags: arkscript/nightly:latest,arkscript/nightly:${{ env.sha_short }}
49+
# keep .git repository
50+
context: .
4051

4152
- name: Build and push harden Docker image
4253
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
4354
with:
44-
username: ${{ secrets.DOCKER_USERNAME }}
45-
password: ${{ secrets.DOCKER_PASSWORD }}
46-
repository: arkscript/harden
47-
dockerfile: harden.dockerfile
48-
# tag with the git commit SHA
49-
tag_with_sha: true
50-
tags: latest
55+
file: harden.dockerfile
56+
tags: arkscript/harden:latest
57+
push: true
58+
# keep .git repository
59+
context: .

0 commit comments

Comments
 (0)