Give images pushed by CI version numbers #4
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
# Prevent more than one build of this workflow for a branch to be running at the | |
# same time, and if multiple are queued, only run the latest, cancelling any | |
# already running build. The exception being any protected branch, such as | |
# master, where a build for every commit will run. | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref_protected == 'true' && github.sha || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
complete: | |
if: always() | |
needs: [latest, testing, future] | |
runs-on: ubuntu-latest | |
steps: | |
- if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') | |
run: exit 1 | |
tag-prefix: | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} | |
runs-on: ubuntu-latest | |
outputs: | |
tag-prefix: ${{ steps.release.outputs.tag-prefix }} | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.event.pull_request.head.sha || github.sha }} | |
- id: release | |
run: | |
count="$(git rev-list HEAD --count --first-parent)" | |
echo "tag-prefix=v${count}-" >> $GITHUB_OUTPUT | |
latest: | |
needs: [tag-prefix] | |
uses: ./.github/workflows/build-latest.yml | |
secrets: | |
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | |
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} | |
with: | |
tag-prefix: ${{ needs.tag-prefix.outputs.tag-prefix }} | |
sha: ${{ github.event.pull_request.head.sha || github.sha }} | |
testing: | |
needs: [tag-prefix] | |
uses: ./.github/workflows/build-testing.yml | |
secrets: | |
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | |
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} | |
with: | |
tag-prefix: ${{ needs.tag-prefix.outputs.tag-prefix }} | |
sha: ${{ github.event.pull_request.head.sha || github.sha }} | |
future: | |
needs: [tag-prefix] | |
uses: ./.github/workflows/build-future.yml | |
secrets: | |
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} | |
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }} | |
with: | |
tag-prefix: ${{ needs.tag-prefix.outputs.tag-prefix }} | |
sha: ${{ github.event.pull_request.head.sha || github.sha }} |