Skip to content

Commit

Permalink
feat: support tag for building image
Browse files Browse the repository at this point in the history
  • Loading branch information
1995parham committed Oct 21, 2023
1 parent 429960b commit de7bcb4
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,28 @@ jobs:
files: coverage.out

docker:
name: docker
runs-on: ubuntu-latest
needs:
- lint
- test
if: github.event_name != 'pull_request'
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: docker/setup-qemu-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/bake-action@v4
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
env:
TAG: ${{ github.ref_name }}
with:
files: "build/package/docker-bake.json"
push: true
files: 'docker-bake.json'
- uses: docker/bake-action@v4
if: ${{ !startsWith(github.ref, 'refs/tags/v') }}
with:
push: true
files: 'docker-bake.json'
7 changes: 6 additions & 1 deletion build/package/docker-bake.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@
]
}
},
"variable": {
"TAG": {
"default": "latest"
}
},
"target": {
"soteria": {
"dockerfile": "build/package/Dockerfile",
"tags": [
"ghcr.io/snapp-incubator/soteria"
"ghcr.io/snapp-incubator/soteria:${TAG}"
]
}
}
Expand Down

0 comments on commit de7bcb4

Please sign in to comment.