expand the number of platforms + remove pull_request event

This commit is contained in:
bkellam 2024-09-19 17:24:27 -07:00
parent bb6f3d91b0
commit 34d4b072dd

View file

@ -4,14 +4,9 @@ name: Publish to ghcr
# @ see: https://docs.docker.com/build/ci/github-actions/multi-platform/#distribute-build-across-multiple-runners # @ see: https://docs.docker.com/build/ci/github-actions/multi-platform/#distribute-build-across-multiple-runners
on: on:
# schedule:
# - cron: '18 10 * * *'
push: push:
branches: ["main"] branches: ["main"]
# Publish semver tags as releases.
tags: ["v*.*.*"] tags: ["v*.*.*"]
pull_request:
branches: ["main"]
env: env:
# Use docker.io for Docker Hub if empty # Use docker.io for Docker Hub if empty
@ -30,6 +25,8 @@ jobs:
matrix: matrix:
platform: platform:
- linux/amd64 - linux/amd64
- linux/arm/v6
- linux/arm/v7
- linux/arm64 - linux/arm64
steps: steps:
@ -54,7 +51,6 @@ jobs:
# Install the cosign tool except on PR # Install the cosign tool except on PR
# https://github.com/sigstore/cosign-installer # https://github.com/sigstore/cosign-installer
- name: Install cosign - name: Install cosign
if: github.event_name != 'pull_request'
uses: sigstore/cosign-installer@v3.5.0 uses: sigstore/cosign-installer@v3.5.0
with: with:
cosign-release: "v2.2.4" cosign-release: "v2.2.4"
@ -64,17 +60,17 @@ jobs:
- name: Login to GitHub Packages Docker Registry - name: Login to GitHub Packages Docker Registry
uses: docker/login-action@v3 uses: docker/login-action@v3
if: github.event_name != 'pull_request'
with: with:
registry: ghcr.io registry: ghcr.io
username: ${{ github.actor }} username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }} password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Docker image - name: Build Docker image
id: build id: build
uses: docker/build-push-action@v6 uses: docker/build-push-action@v6
with: with:
context: . context: .
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha cache-from: type=gha
cache-to: type=gha,mode=max cache-to: type=gha,mode=max
@ -101,7 +97,6 @@ jobs:
# transparency data even for private images, pass --force to cosign below. # transparency data even for private images, pass --force to cosign below.
# https://github.com/sigstore/cosign # https://github.com/sigstore/cosign
- name: Sign the published Docker image - name: Sign the published Docker image
if: ${{ github.event_name != 'pull_request' }}
env: env:
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable # https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
TAGS: ${{ steps.meta.outputs.tags }} TAGS: ${{ steps.meta.outputs.tags }}
@ -114,7 +109,6 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
packages: write packages: write
if: github.event_name != 'pull_request'
needs: needs:
- build - build
steps: steps: