Skip to content

chore(deps): update sigstore/cosign-installer action to v3.3.0 #635

chore(deps): update sigstore/cosign-installer action to v3.3.0

chore(deps): update sigstore/cosign-installer action to v3.3.0 #635

Workflow file for this run

name: Build Images
on:
pull_request:
branches:
- main
push:
branches:
- main
schedule:
- cron: "0 */12 * * *"
workflow_dispatch:
env:
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }}
jobs:
build-base:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
fedora-version: [38, 39]
fedora-edition: [base, silverblue, kinoite]
permissions:
contents: read
packages: write
id-token: write
env:
TAGS: ""
TAGS_CONCAT: ""
IMAGE_NAME: eternal-linux/main/${{ matrix.fedora-edition }}
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Generate Image Metadata
if: github.event_name != 'pull_request'
shell: bash
run: |
TAGS=()
TAGS+=("${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ matrix.fedora-version }}")
TAGS+=("${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:$(git rev-parse --short HEAD)-${{ matrix.fedora-version }}")
echo "TAGS=${TAGS[*]}" >> $GITHUB_ENV
echo "TAGS_CONCAT=$(IFS=, ; echo "${TAGS[*]}")" >> $GITHUB_ENV
- name: Generate Image Metadata (Pull Request)
if: github.event_name == 'pull_request'
shell: bash
run: |
TAGS=()
# Add PR number as a tag
TAGS+=("${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:pr${{ github.event.number }}-${{ matrix.fedora-version }}")
# Add short commit hash with PR number as a tag
TAGS+=("${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:pr${{ github.event.number }}-$(git rev-parse --short HEAD)-${{ matrix.fedora-version }}")
echo "TAGS=${TAGS[*]}" >> $GITHUB_ENV
echo "TAGS_CONCAT=$(IFS=, ; echo "${TAGS[*]}")" >> $GITHUB_ENV
- name: Login to GHCR
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3
- name: Build Image
id: build
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5
with:
context: .
file: Containerfile
push: true
tags: ${{ env.TAGS_CONCAT }}
build-args: |
FEDORA_VERSION=${{ matrix.fedora-version }}
FEDORA_EDITION=${{ matrix.fedora-edition }}
- name: Sign Image
uses: ./.github/actions/sign-image
if: github.event_name != 'pull_request'
with:
registry: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}
digest: ${{ steps.build.outputs.digest }}
private-key: ${{ secrets.ETERNAL_LINUX_SIGNING_KEY }}
private-key-passphrase: ${{ secrets.ETERNAL_LINUX_SIGNING_KEY_PASSPHRASE }}
build-nvidia:
runs-on: ubuntu-latest
needs: build-base
strategy:
fail-fast: false
matrix:
fedora-version: [38, 39]
fedora-edition: [base, silverblue, kinoite]
nvidia-version: [545]
include:
- nvidia-version: 545
nvidia-is-stable: true
permissions:
contents: read
packages: write
id-token: write
env:
TAGS: ""
TAGS_CONCAT: ""
BASE_TAG: ""
IMAGE_NAME: eternal-linux/main/${{ matrix.fedora-edition }}
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Generate Image Metadata
if: github.event_name != 'pull_request'
shell: bash
run: |
TAGS=()
TAGS+=("${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ matrix.fedora-version }}-nvidia${{ matrix.nvidia-version }}")
TAGS+=("${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:$(git rev-parse --short HEAD)-${{ matrix.fedora-version }}-nvidia${{ matrix.nvidia-version }}")
if [[ "${{ matrix.nvidia-is-stable }}" == "true" ]]; then
TAGS+=("${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:${{ matrix.fedora-version }}-nvidia")
TAGS+=("${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:$(git rev-parse --short HEAD)-${{ matrix.fedora-version }}-nvidia")
fi
echo "TAGS=${TAGS[*]}" >> $GITHUB_ENV
echo "TAGS_CONCAT=$(IFS=, ; echo "${TAGS[*]}")" >> $GITHUB_ENV
echo "BASE_TAG=$(git rev-parse --short HEAD)-${{ matrix.fedora-version }}" >> $GITHUB_ENV
- name: Generate Image Metadata (Pull Request)
if: github.event_name == 'pull_request'
shell: bash
run: |
TAGS=()
# Add PR number as a tag
TAGS+=("${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:pr${{ github.event.number }}-${{ matrix.fedora-version }}-nvidia${{ matrix.nvidia-version }}")
# Add short commit hash with PR number as a tag
TAGS+=("${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:pr${{ github.event.number }}-$(git rev-parse --short HEAD)-${{ matrix.fedora-version }}-nvidia${{ matrix.nvidia-version }}")
if [[ "${{ matrix.nvidia-is-stable }}" == "true" ]]; then
TAGS+=("${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:pr${{ github.event.number }}-${{ matrix.fedora-version }}-nvidia")
TAGS+=("${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}:pr${{ github.event.number }}-$(git rev-parse --short HEAD)-${{ matrix.fedora-version }}-nvidia")
fi
echo "TAGS=${TAGS[*]}" >> $GITHUB_ENV
echo "TAGS_CONCAT=$(IFS=, ; echo "${TAGS[*]}")" >> $GITHUB_ENV
echo "BASE_TAG=pr${{ github.event.number }}-$(git rev-parse --short HEAD)-${{ matrix.fedora-version }}" >> $GITHUB_ENV
- name: Login to GHCR
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3
- name: Build Image
id: build
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5
with:
context: .
file: Containerfile.nvidia
push: true
tags: ${{ env.TAGS_CONCAT }}
build-args: |
FEDORA_VERSION=${{ matrix.fedora-version }}
FEDORA_EDITION=${{ matrix.fedora-edition }}
NVIDIA_VERSION=${{ matrix.nvidia-version }}
BASE_TAG=${{ env.BASE_TAG }}
- name: Sign Image
uses: ./.github/actions/sign-image
if: github.event_name != 'pull_request'
with:
registry: ${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}
digest: ${{ steps.build.outputs.digest }}
private-key: ${{ secrets.ETERNAL_LINUX_SIGNING_KEY }}
private-key-passphrase: ${{ secrets.ETERNAL_LINUX_SIGNING_KEY_PASSPHRASE }}
check:
needs: [build-base, build-nvidia]
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
steps:
- name: Exit on failure
if: ${{ needs.build-base.results == 'failure' || needs.build-nvidia.results == 'failure' }}
shell: bash
run: exit 1
- name: Exit on success
shell: bash
run: exit 0