Docker Build & Release #10
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: Docker Build & Release | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- 'v*.*' | |
jobs: | |
gettag: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Set UUID | |
id: generate-uuid | |
run: echo "uuid=${{ github.sha }}" >> $GITHUB_OUTPUT | |
outputs: | |
uuid: ${{ steps.generate-uuid.outputs.uuid }} | |
build: | |
needs: [gettag] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
# https://github.com/docker/setup-qemu-action | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
with: | |
platforms: arm64 | |
- name: 'Login to GitHub Container Registry' | |
uses: docker/login-action@v3 | |
with: | |
username: ${{secrets.DOCKER_USERNAME}} | |
password: ${{secrets.DOCKER_TOKEN}} | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
with: | |
driver-opts: image=moby/buildkit:latest | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
registry: docker.io | |
image: effiana/php8.2-fpm | |
directory: . | |
file: php/8.2-fpm/Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
enableBuildKit: true | |
multiPlatform: true | |
overrideDriver: true | |
addLatest: true | |
pushImage: true | |
push: true | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
tags: | | |
effiana/php-8.2-fpm:${{needs.gettag.outputs.uuid}} | |
effiana/php-8.2-fpm:latest | |
- name: Build and push | |
uses: docker/build-push-action@v5 | |
with: | |
registry: docker.io | |
image: effiana/php8.2-supervisor | |
directory: . | |
file: php/8.2-fpm/Dockerfile | |
platforms: linux/amd64,linux/arm64 | |
enableBuildKit: true | |
multiPlatform: true | |
overrideDriver: true | |
addLatest: true | |
pushImage: true | |
push: true | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
tags: | | |
effiana/php-8.2-supervisor:${{needs.gettag.outputs.uuid}} | |
effiana/php-8.2-supervisor:latest |