chore(deps): update docker/build-push-action action to v6 (#529) #382
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
# Summary: | |
# | |
# job docker-main-latest: | |
# * for push to main branch, update "latest" tag | |
# | |
# job docker-sha-release-latest: | |
# * for release, update "latest" tag | |
# * git ref tag, eg. "sha-ad132f5" | |
# * release tag major.minor.path, e.g. "1.2.3" (alpine g80) | |
# * release tag major.minor, e.g. "1.2" (alpine g78) | |
name: Docker | |
on: | |
push: | |
branches: [main] | |
tags: ['*.*.*'] | |
paths-ignore: ['docs/**'] | |
release: | |
types: [published] | |
env: | |
# Additionally mentioned in docker-sha-release-latest | |
# as use of variable fails there | |
DOCKERHUB_REPOSITORY: mundialis/actinia-core | |
jobs: | |
# only run for push to main branch | |
# take care of latest tag | |
docker-main-latest: | |
name: build and push latest for main branch | |
if: startsWith(github.ref, 'refs/heads/main') && github.repository_owner == 'actinia-org' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | |
- id: meta | |
name: Create tag name | |
run: | | |
tag=${DOCKERHUB_REPOSITORY}:latest | |
echo "tags=$tag" >> "$GITHUB_OUTPUT" | |
- name: log | |
run: echo ${{ steps.meta.outputs.tags }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push | |
id: docker_build | |
uses: docker/build-push-action@v6 | |
with: | |
push: true | |
pull: true | |
context: . | |
tags: ${{ steps.meta.outputs.tags }} | |
file: docker/actinia-core-alpine/Dockerfile | |
- name: Image digest | |
run: echo ${{ steps.docker_build.outputs.digest }} | |
# run always | |
# On push to branch, take care of sha-ref tag | |
# On release, take care of latest and release tags | |
docker-sha-release-latest: | |
name: build and push release or latest | |
if: startsWith(github.ref, 'refs/tags/') && github.repository_owner == 'actinia-org' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4 | |
- name: Create image and tag names | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
# images: ${DOCKERHUB_REPOSITORY} | |
images: mundialis/actinia-core | |
tags: | | |
type=ref,event=tag | |
type=semver,pattern={{major}}.{{minor}} | |
type=sha | |
flavor: | | |
latest=auto | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and push | |
id: docker_build | |
uses: docker/build-push-action@v6 | |
with: | |
push: true | |
pull: true | |
context: . | |
tags: ${{ steps.meta.outputs.tags }} | |
file: docker/actinia-core-alpine/Dockerfile | |
- name: Image digest | |
run: echo ${{ steps.docker_build.outputs.digest }} |