Fix check-end-of-life.sh invocation for new --filter option
#16
This file contains hidden or 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: Build & publish container | |
| on: | |
| push: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| inputs: | |
| branch: | |
| description: Debian version branch | |
| required: false | |
| type: string | |
| concurrency: build | |
| env: | |
| CI_TOOLS_SETUP: https://raw.githubusercontent.com/SGSGermany/ci-tools/main/setup.sh | |
| defaults: | |
| run: | |
| shell: bash -eu -o pipefail {0} | |
| jobs: | |
| generate-jobs: | |
| name: Generate jobs | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| outputs: | |
| BUILD_MATRIX: ${{ steps.generate-jobs.outputs.BUILD_MATRIX }} | |
| steps: | |
| - name: Setup CI tools | |
| run: | | |
| . <(curl -fsS -L "$CI_TOOLS_SETUP" | bash -s ~/ci-tools) | |
| echo "CI_TOOLS=$CI_TOOLS" | tee -a "$GITHUB_ENV" | |
| echo "CI_TOOLS_PATH=$CI_TOOLS_PATH" | tee -a "$GITHUB_ENV" | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Generate jobs | |
| id: generate-jobs | |
| env: | |
| MILESTONES: ${{ inputs.branch }} | |
| run: | | |
| [ -n "$MILESTONES" ] || { MILESTONES="$(./branches.sh)" || EXIT_CODE=$?; } | |
| echo ::group::Jobs list | |
| echo "$MILESTONES" | |
| echo ::endgroup:: | |
| echo "BUILD_MATRIX=$([ -z "$MILESTONES" ] || jq -Rcn '{"MILESTONE": [inputs]}' <<< "$MILESTONES")" >> $GITHUB_OUTPUT | |
| exit ${EXIT_CODE:-0} | |
| build: | |
| name: Build & publish container | |
| needs: generate-jobs | |
| if: ${{ always() && needs.generate-jobs.outputs.BUILD_MATRIX }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| concurrency: build-${{ matrix.MILESTONE }} | |
| strategy: | |
| matrix: ${{ fromJSON(needs.generate-jobs.outputs.BUILD_MATRIX) }} | |
| fail-fast: false | |
| env: | |
| REGISTRY: ghcr.io | |
| OWNER: sgsgermany | |
| IMAGE: debian | |
| MILESTONE: ${{ matrix.MILESTONE }} | |
| steps: | |
| - name: Setup CI tools | |
| run: | | |
| . <(curl -fsS -L "$CI_TOOLS_SETUP" | bash -s ~/ci-tools) | |
| echo "CI_TOOLS=$CI_TOOLS" | tee -a "$GITHUB_ENV" | |
| echo "CI_TOOLS_PATH=$CI_TOOLS_PATH" | tee -a "$GITHUB_ENV" | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Log into container registry ${{ env.REGISTRY }} | |
| uses: redhat-actions/podman-login@v1 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Generate container image tags | |
| run: | | |
| source <(./tags.sh "$GITHUB_RUN_ID.$GITHUB_RUN_NUMBER") | |
| echo "MILESTONE=$MILESTONE" | tee -a "$GITHUB_ENV" | |
| echo "VERSION=$VERSION" | tee -a "$GITHUB_ENV" | |
| echo "TAGS=$TAGS" | tee -a "$GITHUB_ENV" | |
| - name: Build container image | |
| run: | | |
| buildah unshare ./build.sh | |
| # Workaround for https://github.com/redhat-actions/push-to-registry/issues/66 | |
| - name: Delete base image | |
| run: | | |
| podman rmi "$(. ./container.env ; echo "$BASE_IMAGE")" | |
| - name: Container image metadata | |
| run: | | |
| podman image inspect "localhost/$IMAGE:${TAGS%% *}" | |
| - name: Push container image | |
| uses: redhat-actions/push-to-registry@v2 | |
| with: | |
| image: ${{ env.IMAGE }} | |
| registry: ${{ env.REGISTRY }}/${{ env.OWNER }} | |
| tags: ${{ env.TAGS }} |