Update pool.conf (#20) #52
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: "Multi-arch docker build" | |
# Controls when the workflow will run | |
on: | |
push: | |
branches: ['main'] | |
tags: | |
- 'v*.*.*' | |
pull_request: | |
branches: ['main'] | |
env: | |
TEST_TAG: ministryofjustice/intranet-base:test | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# First, checkout | |
- name: Checkout | |
uses: actions/[email protected] | |
# QEMU; multi-arch stuff | |
- name: Set up QEMU | |
uses: docker/[email protected] | |
# get buildx - build multi-arch stuff | |
- name: Set up Docker Buildx | |
id: buildx | |
uses: docker/[email protected] | |
# Access Docker Hub | |
- name: Login to Docker Hub | |
if: github.event_name != 'pull_request' | |
uses: docker/[email protected] | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
# Setup test build for PRs | |
- name: Test - build and export to Docker | |
if: github.event_name == 'pull_request' | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
load: true | |
tags: ${{ env.TEST_TAG }} | |
# Gather meta for the builds | |
- name: Docker meta | |
if: github.event_name != 'pull_request' | |
id: intranet-base-meta | |
uses: docker/[email protected] | |
with: | |
images: ministryofjustice/intranet-base | |
tags: | | |
type=ref,event=branch | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
type=semver,pattern={{major}} | |
flavor: | | |
latest=true | |
# perform the builds | |
- name: Build and push | |
if: github.event_name != 'pull_request' | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
platforms: | | |
linux/amd64 | |
linux/arm/v7 | |
linux/arm64 | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.intranet-base-meta.outputs.tags }} | |
labels: ${{ steps.intranet-base-meta.outputs.labels }} |