[2.2] Alpine Linux 3.20 #343
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: build | |
concurrency: | |
group: build-${{ github.ref }} | |
cancel-in-progress: true | |
on: | |
push: | |
branches: | |
- 'master' | |
- 'releases/*' | |
tags: | |
- '*' | |
paths-ignore: | |
- '**.md' | |
pull_request: | |
branches: | |
- 'master' | |
- 'releases/*' | |
paths-ignore: | |
- '**.md' | |
env: | |
DOCKERHUB_SLUG: crazymax/alpine-s6 | |
GHCR_SLUG: ghcr.io/crazy-max/alpine-s6 | |
DOCKERHUB_DIST_SLUG: crazymax/alpine-s6-dist | |
GHCR_DIST_SLUG: ghcr.io/crazy-max/alpine-s6-dist | |
ALPINE_LATEST: '3.20' | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
alpine_version: | |
- '3.15' | |
- '3.16' | |
- '3.17' | |
- '3.18' | |
- '3.19' | |
- '3.20' | |
- 'edge' | |
runs-on: ubuntu-latest | |
steps: | |
- | |
name: Checkout | |
uses: actions/checkout@v3 | |
- | |
name: Prepare | |
run: | | |
ALPINE_VERSION=${{ matrix.alpine_version }} | |
IMAGE_TAGS= | |
if [[ $GITHUB_REF == refs/tags/* ]]; then | |
TAG=${GITHUB_REF#refs/tags/} | |
VERSION=${TAG%-r*} | |
IMAGE_TAGS="${ALPINE_VERSION}-${VERSION}" | |
fi | |
echo "IMAGE_TAGS<<EOF" >> $GITHUB_ENV | |
echo -e "$IMAGE_TAGS" >> $GITHUB_ENV | |
echo "EOF" >> $GITHUB_ENV | |
- | |
name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: | | |
${{ env.DOCKERHUB_SLUG }} | |
${{ env.GHCR_SLUG }} | |
tags: ${{ env.IMAGE_TAGS }} | |
labels: | | |
org.opencontainers.image.title=alpine-s6 | |
org.opencontainers.image.description=Alpine Linux with s6 overlay | |
org.opencontainers.image.vendor=CrazyMax | |
- | |
name: Docker meta dist | |
id: meta_dist | |
uses: docker/metadata-action@v4 | |
with: | |
images: | | |
${{ env.DOCKERHUB_DIST_SLUG }} | |
${{ env.GHCR_DIST_SLUG }} | |
tags: ${{ env.IMAGE_TAGS }} | |
labels: | | |
org.opencontainers.image.title=alpine-s6-dist | |
org.opencontainers.image.description=s6 overlay | |
org.opencontainers.image.vendor=CrazyMax | |
- | |
name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- | |
name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
with: | |
buildkitd-config-inline: | | |
[worker.oci] | |
max-parallelism = 4 | |
- | |
name: Login to DockerHub | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- | |
name: Login to GitHub Container Registry | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- | |
name: Build artifacts | |
uses: docker/bake-action@v3 | |
with: | |
targets: artifact-all | |
pull: true | |
provenance: false | |
env: | |
ALPINE_VERSION: ${{ matrix.alpine_version }} | |
- | |
name: Move artifacts | |
if: matrix.alpine_version == env.ALPINE_LATEST | |
run: | | |
mv ./dist/**/* ./dist/ | |
- | |
name: Upload artifacts | |
if: matrix.alpine_version == env.ALPINE_LATEST | |
uses: actions/upload-artifact@v2 | |
with: | |
name: s6-overlay | |
path: ./dist/* | |
if-no-files-found: error | |
- | |
name: Build image | |
uses: docker/bake-action@v3 | |
with: | |
files: | | |
./docker-bake.hcl | |
${{ steps.meta.outputs.bake-file }} | |
targets: image-all | |
push: ${{ startsWith(github.ref, 'refs/tags/') }} | |
env: | |
ALPINE_VERSION: ${{ matrix.alpine_version }} | |
- | |
name: Build dist | |
uses: docker/bake-action@v3 | |
with: | |
files: | | |
./docker-bake.hcl | |
${{ steps.meta_dist.outputs.bake-file }} | |
targets: image-dist-all | |
pull: true | |
push: ${{ startsWith(github.ref, 'refs/tags/') }} | |
env: | |
ALPINE_VERSION: ${{ matrix.alpine_version }} | |
- | |
name: GitHub Release | |
uses: softprops/action-gh-release@v1 | |
if: matrix.alpine_version == env.ALPINE_LATEST && startsWith(github.ref, 'refs/tags/') | |
with: | |
draft: true | |
files: | | |
dist/*.tar.gz | |
dist/*.zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- | |
name: Check manifest | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
docker buildx imagetools inspect ${{ env.DOCKERHUB_SLUG }}:${{ steps.meta.outputs.version }} | |
docker buildx imagetools inspect ${{ env.GHCR_SLUG }}:${{ steps.meta.outputs.version }} | |
- | |
name: Check pull | |
if: startsWith(github.ref, 'refs/tags/') | |
run: | | |
docker pull ${{ env.DOCKERHUB_SLUG }}:${{ steps.meta.outputs.version }} | |
docker image inspect ${{ env.DOCKERHUB_SLUG }}:${{ steps.meta.outputs.version }} | |
docker pull ${{ env.GHCR_SLUG }}:${{ steps.meta.outputs.version }} | |
docker image inspect ${{ env.GHCR_SLUG }}:${{ steps.meta.outputs.version }} |