Skip to content

Bump step-security/harden-runner from 2.5.1 to 2.6.0 #56

Bump step-security/harden-runner from 2.5.1 to 2.6.0

Bump step-security/harden-runner from 2.5.1 to 2.6.0 #56

name: Cross-Compile Docker
on:
push:
branches: [ main ]
paths:
- .github/workflows/docker-publish-xcomp.yml
- .docker/ubuntu-20.04/*
- .docker/ubuntu-22.04/*
pull_request:
branches: [ main ]
paths:
- .github/workflows/docker-publish-xcomp.yml
- .docker/ubuntu-20.04/*
- .docker/ubuntu-22.04/*
permissions: read-all
env:
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}/linux-build-xcomp
jobs:
build:
strategy:
fail-fast: false
matrix:
version: ['20.04', '22.04']
name: Build
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Harden Runner
uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
# Login against a Docker registry except on PR
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
if: github.event_name != 'pull_request'
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09
with:
context: .docker/ubuntu-${{ matrix.version }}
file: .docker/ubuntu-${{ matrix.version }}/Dockerfile
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ matrix.version }}
labels: ${{ steps.meta.outputs.labels }}