Skip to content

Commit

Permalink
fix workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
reschandreas committed Dec 25, 2023
1 parent ad5ce3d commit f670a9a
Showing 1 changed file with 24 additions and 14 deletions.
38 changes: 24 additions & 14 deletions .github/workflows/build-and-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,25 +53,35 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
- name: Compute Tag
uses: actions/github-script@v7
id: compute-tag
with:
images: ${{ matrix.image }}
tags: |
# set latest tag for default branch
type=raw,value={{date 'YYYYMMDD-hhmmss' tz='Europe/Berlin'}}
type=ref,event=pr
type=sha
type=raw,value=nightly,enable={{is_default_branch}}
result-encoding: string
script: |
if (context.eventName === "pull_request") {
return "pr-" + context.issue.number;
}
if (context.eventName === "release") {
return "latest";
}
if (context.eventName === "push") {
if (context.ref.startsWith("refs/tags/")) {
return context.ref.slice(10);
}
if (context.ref === "refs/heads/develop") {
return "nightly";
}
}
return "FALSE";
- name: Build and push
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: .
file: ${{ matrix.dockerfile }}
platforms: linux/amd64,linux/arm64
push: ${{ github.ref_name == 'develop' }}
tags: ${{ steps.meta.outputs.tags }}
push: true
tags: ${{ steps.compute-tag.outputs.result }}
labels: ${{ steps.meta.outputs.labels }}


0 comments on commit f670a9a

Please sign in to comment.