Skip to content

Build Alpine

Build Alpine #335

Workflow file for this run

name: Build Alpine
on:
push:
branches:
- master
paths:
- "alpine/**"
- ".github/workflows/alpine.yml"
- ".github/actions/build-docker-image/**"
pull_request:
paths:
- "alpine/**"
- ".github/workflows/alpine.yml"
- ".github/actions/build-docker-image/**"
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
push_to_registry:
name: Push Docker image to GitHub Packages
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
pull-requests: write
security-events: write
steps:
- name: Check out the repo
uses: actions/checkout@v4
- name: Get image version
id: getversion
run: echo "version=$(head -n 1 alpine/Dockerfile | sed -r -e 's/^([^:]+):([^ @$-]+).*/\2/')" >> "${GITHUB_OUTPUT}"
- name: Build and push image
uses: ./.github/actions/build-docker-image
with:
context: alpine
push: ${{ github.base_ref == null }}
cache-from: type=gha,scope=alpine
cache-to: type=gha,mode=max,scope=alpine
no-cache: ${{ github.event_name == 'workflow_dispatch' }}
primaryTag: ghcr.io/automattic/vip-container-images/alpine:${{ steps.getversion.outputs.version }}
tags: ghcr.io/automattic/vip-container-images/alpine:latest