Skip to content

Update build OSes, pre-install Python #71

Update build OSes, pre-install Python

Update build OSes, pre-install Python #71

Workflow file for this run

name: "apkbuild"
concurrency:
group: ${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}
cancel-in-progress: true
on:
push:
branches:
- main
paths:
- apk/**
pull_request:
types: [opened, synchronize, reopened]
paths:
- apk/**
jobs:
build-and-push:
runs-on: ubuntu-latest
strategy:
matrix:
# These versions must be strings. E.g. Otherwise `3.10` -> `3.1`
alpine:
- 'alpine'
steps:
- name: "Checkout source code at current commit"
uses: actions/checkout@v4
- name: Prepare tags for Docker image
id: prepare
env:
BUILDER: apkbuild
MATRIX_TAG: ${{matrix.alpine}}
run: |
DOCKER_IMAGE=${{ github.repository }}-${BUILDER}
TAGS="${DOCKER_IMAGE}:${MATRIX_TAG},${DOCKER_IMAGE}:latest"
COMMIT_SHA="${GITHUB_SHA}"
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/}
elif [[ $GITHUB_REF == refs/pull/* ]]; then
VERSION=pr-${{ github.event.pull_request.number }}
COMMIT_SHA=${{ github.event.pull_request.head.sha }}
fi
TAGS="$TAGS,${DOCKER_IMAGE}:sha-${COMMIT_SHA:0:7}"
if [[ -n $VERSION ]]; then
TAGS="$TAGS,${DOCKER_IMAGE}:${VERSION}"
fi
echo "tags=${TAGS}" >> $GITHUB_OUTPUT
- 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_PASSWORD }}
- name: "Build and push APK builder docker image to DockerHub"
id: docker_build_builder
uses: docker/build-push-action@v5
with:
push: true
provenance: false
tags: ${{ steps.prepare.outputs.tags }}
file: apk/Dockerfile-${{matrix.alpine}}