Publish arm docker base image #160
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: Docker Build Images (AMD64) | |
env: | |
# Also remember to change the 'docker/build.sh' script | |
IMAGE_VER: "v2" | |
on: | |
schedule: | |
# Once every Wednesday at 00:00 | |
- cron: '0 0 * * 3' | |
push: | |
branches: | |
- master | |
paths: | |
- 'docker/**' | |
- '.github/workflows/vcpkg_docker_amd64.yml' | |
pull_request: | |
paths: | |
- 'docker/**' | |
- '.github/workflows/vcpkg_docker_amd64.yml' | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
container: | |
- { version: '22.04', codename: 'jammy' } | |
platform: | |
- 'linux/amd64' | |
- 'linux/arm64/v8' # Apple Silicon Linux support | |
runs-on: ubuntu-22.04 | |
permissions: | |
packages: write | |
contents: read | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Generate Image Name | |
env: | |
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | |
run: | | |
test_name="" | |
if [[ "${GITHUB_REF}" != "refs/heads/master" ]] ; then | |
test_name="test-${BRANCH_NAME////_}-" | |
fi | |
echo "IMAGE_NAME=ghcr.io/lifting-bits/cxx-common/${test_name}vcpkg-builder-ubuntu-${{ env.IMAGE_VER }}:${{ matrix.container.version }}" >> ${GITHUB_ENV} | |
- name: Build image | |
working-directory: docker | |
run: | | |
# Pull freshest ubuntu Docker image | |
docker pull --platform "${{ matrix.platform }}" ubuntu:${{ matrix.container.version}} | |
docker build -f Dockerfile.ubuntu.vcpkg \ | |
--no-cache \ | |
--platform "${{ matrix.platform }}" \ | |
--target caching \ | |
--build-arg "DISTRO_VERSION=${{ matrix.container.codename }}" \ | |
-t "${IMAGE_NAME}" \ | |
. | |
- name: Log in to registry | |
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin | |
- name: Push image | |
run: docker push "${IMAGE_NAME}" |