Files
Dylan M. Taylor 22b2a64dad ci: use StepSecurity's maintained actions (#3)
Each third-party action that StepSecurity publishes a secure drop-in
replacement for now uses that replacement, pinned to a commit with its
version as a comment. Versions follow what we used: the newest
StepSecurity release in the same major, or the closest major they
publish. dtolnay/rust-toolchain refs that named a toolchain (stable,
nightly, 1.76) become the replacement's `toolchain` input.
2026-11-11 14:58:11 -05:00

87 lines
2.9 KiB
YAML

name: build-docker-image
on:
push:
tags:
- "[0-2].[0-9]+.[0-9]+*"
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Harden runner
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@v4
# For multi platform build. See https://docs.docker.com/build/ci/github-actions/multi-platform/
- name: Set up QEMU
uses: step-security/setup-qemu-action@8c4aef027ab2df56e08f597afe6dd8cd31cb84f5 # v3.7.0
- name: Set up Docker Buildx
uses: step-security/setup-buildx-action@c60a792b446ef83310733d5cd9d0c8d6870d043f # v3.12.0
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: step-security/metadata-action@21378f5b76c96c69ac34d21cc3873d85e26381b1 # v6.2.0
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{version}}
- name: Login to Container Registry
uses: step-security/docker-login-action@6aa05fe688caf2c58e784663f01b3415ced503e8 # v3.7.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.PAT }}
- name: Build and push Docker image
uses: step-security/docker-build-push-action@b736dc8a921e02a288f956d3dd9111e276a4cfec # v7.4.0
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
chart-release:
runs-on: ubuntu-20.04
needs: build-and-push-image
permissions:
contents: write
steps:
- name: Harden runner
uses: step-security/harden-runner@1d88384fd173af6ecb012dfd0264a306b711241a # v2.22.4
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Install Helm
uses: step-security/setup-helm@104176d810f424da7451a3fe25620d40c4dfb883 # v5.0.1
- name: sed
run: |
sed -i "s/CHART_VERSION/${{ github.ref_name }}/" charts/irsa-manager/Chart.yaml
sed -i "s/APP_VERSION/${{ github.ref_name }}/" charts/irsa-manager/Chart.yaml
sed -i "s/APP_VERSION/${{ github.ref_name }}/" charts/irsa-manager/values.yaml
- name: Run chart-releaser
uses: step-security/chart-releaser-action@2b48db14caa239f19dc7940b87eec9ef439abf33 # v1.7.0
with:
config: cr.yaml
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"