Skip to content

chore(master): release 1.50.0 [skip-ci] (#1142) #499

chore(master): release 1.50.0 [skip-ci] (#1142)

chore(master): release 1.50.0 [skip-ci] (#1142) #499

Workflow file for this run

name: Build and publish a Docker image for master branch
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
on:
push:
branches:
- master
# Default to read-only permissions
permissions: read-all
jobs:
check_commit:
runs-on: ubuntu-latest
outputs:
should_run: ${{ steps.check_commit_message.outputs.should_run }}
steps:
- name: Checkout code
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
with:
fetch-depth: 2
- name: Check commit message
id: check_commit_message
run: |
COMMIT_MSG=$(git log -1 --pretty=%s)
if [[ "$COMMIT_MSG" == chore* ]]; then
echo "should_run=false" >> $GITHUB_OUTPUT
echo "Skipping workflow for commit: $COMMIT_MSG"
else
echo "should_run=true" >> $GITHUB_OUTPUT
echo "Running workflow for commit: $COMMIT_MSG"
fi
docker:
needs: check_commit
if: ${{ needs.check_commit.outputs.should_run == 'true' }}
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6
- name: Set up QEMU
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3
with:
platforms: 'arm64'
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3
with:
platforms: linux/arm64,linux/amd64
- name: Login to GHCR
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: |
latest=false
tags: |
type=raw,value=latest
- name: Build and push Docker image
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6
id: push
with:
context: .
push: true
platforms: ${{ steps.buildx.outputs.platforms }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Generate artifact attestation
uses: actions/attest-build-provenance@e8998f949152b193b063cb0ec769d69d929409be # v2
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true