Skip to content

Alpine image and pipeline #29

Alpine image and pipeline

Alpine image and pipeline #29

Workflow file for this run

name: Build and Publish Docker Image
on:
pull_request:
branches:
- '*'
jobs:
build-and-publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
driver: docker
# Build all the tags for the image
- name: Create tags
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/2pisoftware/cmfive
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
# Login to GHCR
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Build the boilerplate image, the final image requires this
- name: Build boilerplate image
uses: docker/build-push-action@v5
with:
context: .
push: false
tags: cmfive-boilerplate:latest
load: true # Use the built image in the next step
# Build the theme, copy it to boilerplate, tag and push
- name: Build and push cmfive image
uses: docker/build-push-action@v5
with:
context: ./.codepipeline/docker
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}