Skip to content
This repository has been archived by the owner on Apr 22, 2024. It is now read-only.

fix: tags not properly being set in ostree remote #1

fix: tags not properly being set in ostree remote

fix: tags not properly being set in ostree remote #1

---
name: isogenerator-image
on:
pull_request:
branches:
- main
paths:
- 'Dockerfile'
push:
branches:
- main
paths:
- 'Dockerfile'
workflow_dispatch:
env:
IMAGE_NAME: isogenerator
IMAGE_REGISTRY: "ghcr.io/${{ github.repository_owner }}"
jobs:
push-ghcr:
name: Build and push image
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
id-token: write
strategy:
fail-fast: false
steps:
# Checkout push-to-registry action GitHub repository
- name: Checkout Push to Registry action
uses: actions/checkout@v3
- name: Generate tags
id: generate-tags
shell: bash
run: |
# Generate a timestamp for creating an image version history
TIMESTAMP="$(date +%Y%m%d)"
COMMIT_TAGS=()
BUILD_TAGS=()
# Have tags for tracking builds during pull request
SHA_SHORT="${GITHUB_SHA::7}"
COMMIT_TAGS+=("pr-${{ github.event.number }}
COMMIT_TAGS+=("${SHA_SHORT}
COMMIT_TAGS+=("pr-${{ github.event.number }}")
COMMIT_TAGS+=("${SHA_SHORT}")
BUILD_TAGS+=("${TIMESTAMP}")
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "Generated the following commit tags: "
for TAG in "${COMMIT_TAGS[@]}"; do
echo "${TAG}"
done
alias_tags=("${COMMIT_TAGS[@]}")
else
BUILD_TAGS+=("latest")
alias_tags=("${BUILD_TAGS[@]}")
fi
echo "Generated the following build tags: "
for TAG in "${BUILD_TAGS[@]}"; do
echo "${TAG}"
done
echo "alias_tags=${alias_tags[*]}" >> $GITHUB_OUTPUT
# Build metadata
- name: Image Metadata
uses: docker/metadata-action@v4
id: meta
with:
images: |
${{ env.IMAGE_REGISTRY }}/${{ env.IMAGE_NAME }}
labels: |
io.artifacthub.package.readme-url=https://raw.githubusercontent.com/${{ github.repository }}/main/README.md
org.opencontainers.image.description=A container image for generating Universal Blue ISO files
org.opencontainers.image.title=${{ env.IMAGE_NAME }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push Image
uses: docker/build-push-action@v4
with:
context: ./
file: ./Dockerfile
push: ${{ github.event_name != 'pull_request' }}
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.generate-tags.outputs.alias_tags }}
check:
name: Check build successful
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
needs: [isogenerator-image]

Check failure on line 110 in .github/workflows/isogenerator-image.yml

View workflow run for this annotation

GitHub Actions / isogenerator-image

Invalid workflow file

The workflow is not valid. .github/workflows/isogenerator-image.yml (Line: 110, Col: 13): Job 'check' depends on unknown job 'isogenerator-image'.
steps:
- name: Exit on failure
if: ${{ needs.isogenerator-image.result == 'failure' || needs.isogenerator-image.result == 'skipped' }}
shell: bash
run: exit 1
- name: Exit
shell: bash
run: exit 0