6.2.0 #4
Workflow file for this run
This file contains hidden or 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: Docker Cloud Build | |
on: | |
release: | |
types: | |
- published | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Log in to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Set up Docker Buildx (cloud driver) | |
uses: docker/setup-buildx-action@v3 | |
with: | |
version: lab:latest | |
driver: cloud | |
endpoint: fontebasso/multiarch-builder | |
- name: Extract release version | |
id: version | |
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | |
- name: Build for amd64 | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
tags: | | |
fontebasso/php-nginx:${{ env.RELEASE_VERSION }}-amd64 | |
platforms: linux/amd64 | |
push: true | |
attestations: | | |
type=provenance,mode=max | |
- name: Build for arm64 | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
tags: | | |
fontebasso/php-nginx:${{ env.RELEASE_VERSION }}-arm64 | |
platforms: linux/arm64 | |
push: true | |
attestations: | | |
type=provenance,mode=max | |
- name: Merge and push multi-arch | |
run: | | |
docker buildx imagetools create \ | |
--tag fontebasso/php-nginx:${{ env.RELEASE_VERSION }} \ | |
--tag fontebasso/php-nginx:latest \ | |
fontebasso/php-nginx:${{ env.RELEASE_VERSION }}-amd64 \ | |
fontebasso/php-nginx:${{ env.RELEASE_VERSION }}-arm64 | |
- name: Clean up intermediate tags | |
run: | | |
docker logout | |
echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin | |
docker rmi fontebasso/php-nginx:${{ env.RELEASE_VERSION }}-amd64 || true | |
docker rmi fontebasso/php-nginx:${{ env.RELEASE_VERSION }}-arm64 || true |