chore(nginx-rootless): update nginx docker tag to v1.27.3 #744
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker publish | |
on: | |
push: | |
branches: | |
- 'master' | |
pull_request: | |
types: [opened, reopened, synchronize] | |
workflow_dispatch: | |
env: | |
REGISTRY: ghcr.io | |
jobs: | |
list_containers: | |
name: List containers to build | |
runs-on: ubuntu-latest | |
outputs: | |
matrix: ${{ steps.set-matrix.outputs.MATRIX }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
with: | |
fetch-depth: '0' | |
- name: Generate containers list with parameters | |
id: set-matrix | |
run: | | |
GIT_DIFF_ENABLED=0 | |
if [ '${{ github.event_name }}' = 'push' ] ; then | |
GIT_DIFF_ENABLED=1 | |
GIT_DIFF_BASE='${{ github.event.before }}' | |
GIT_DIFF_HEAD='${{ github.event.after }}' | |
elif [ '${{ github.event_name }}' = 'pull_request' ] ; then | |
GIT_DIFF_ENABLED=1 | |
GIT_DIFF_BASE='${{ github.event.pull_request.base.sha }}' | |
GIT_DIFF_HEAD='${{ github.event.pull_request.head.sha }}' | |
fi | |
{ | |
echo "MATRIX<<9743a66f914cc249efca164485a19c5c" | |
./scripts/grab_props.sh "$GIT_DIFF_ENABLED" "$GIT_DIFF_BASE" "$GIT_DIFF_HEAD" | yq -p yaml -o json -I 0 . | |
echo 9743a66f914cc249efca164485a19c5c | |
} >> "$GITHUB_OUTPUT" | |
build: | |
name: "Build container: ${{ matrix.container }}" | |
runs-on: ubuntu-latest | |
needs: list_containers | |
permissions: | |
contents: read | |
packages: write | |
# This is used to complete the identity challenge | |
# with sigstore/fulcio when running outside of PRs. | |
id-token: write | |
if: needs.list_containers.outputs.matrix != '[]' | |
strategy: | |
fail-fast: false | |
matrix: | |
include: ${{ fromJSON(needs.list_containers.outputs.matrix) }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Generate properties | |
id: props | |
run: | | |
PLATFORMS_DEFAULT="linux/amd64,linux/arm64" | |
APP_VERSION_DEFAULT="0.1.0" | |
REVISION_DEFAULT="1" | |
PLATFORMS="${{ matrix.platforms }}" | |
APP_VERSION="${{ matrix.app_version }}" | |
REVISION="${{ matrix.revision }}" | |
platforms="${PLATFORMS:-"${PLATFORMS_DEFAULT}"}" | |
app_version="${APP_VERSION:-"${APP_VERSION_DEFAULT}"}" | |
revision="${REVISION:-"${REVISION_DEFAULT}"}" | |
{ | |
echo "platforms=$platforms" | |
echo "app_version=$app_version" | |
echo "revision=$revision" | |
echo "version=${app_version}-r${revision}" | |
} >> "$GITHUB_OUTPUT" | |
# Workaround: https://github.com/docker/build-push-action/issues/461 | |
- name: Setup Docker buildx | |
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3.7.1 | |
- name: Log into registry ${{ env.REGISTRY }} | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract Docker metadata | |
id: meta | |
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 # v5.6.1 | |
with: | |
images: ${{ env.REGISTRY }}/${{ github.repository }}/${{ matrix.container }} | |
labels: | | |
org.opencontainers.image.title=${{ matrix.container }} | |
org.opencontainers.image.description=${{ matrix.description }} | |
tags: | | |
type=ref,event=branch,priority=1990 | |
type=ref,event=pr,priority=2999 | |
type=raw,value=latest,enable={{is_default_branch}} | |
type=raw,enable={{is_default_branch}},value=${{ steps.props.outputs.version }},priority=1999 | |
type=raw,enable={{is_default_branch}},value=${{ steps.props.outputs.app_version }},priority=1998 | |
type=semver,enable={{is_default_branch}},value=${{ steps.props.outputs.app_version }},pattern={{major}}.{{minor}},priority=1997 | |
type=semver,enable={{is_default_branch}},value=${{ steps.props.outputs.app_version }},pattern={{major}},priority=1996 | |
- name: Build and push Docker image | |
id: build-and-push | |
uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355 # v6.10.0 | |
with: | |
context: containers/${{ matrix.container }} | |
push: true | |
platforms: ${{ steps.props.outputs.platforms }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |