This repository was archived by the owner on Jun 12, 2025. It is now read-only.
Merge pull request #11 from EVOGD-Project/dev #10
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: 'CD -> Container' | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - stable | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: false | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| name: 'Build & publish container image' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| packages: write | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: ${{ github.repository }} | |
| steps: | |
| - name: 'Checkout' | |
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
| - name: 'Setup tags' | |
| id: setup-tags | |
| run: | | |
| TIMESTAMP="$(date +%Y.%m.%d)" | |
| SHA_SHORT="${GITHUB_SHA::7}" | |
| TAGS=() | |
| TAGS+=("latest") | |
| TAGS+=("${GITHUB_SHA}") | |
| TAGS+=("${TIMESTAMP}-${SHA_SHORT}") | |
| echo "build-tags=${TAGS[*]}" >> $GITHUB_OUTPUT | |
| - name: 'Build image' | |
| id: build-image | |
| uses: redhat-actions/buildah-build@7a95fa7ee0f02d552a32753e7414641a04307056 # master | |
| with: | |
| archs: amd64 | |
| containerfiles: Dockerfile | |
| image: ${{ env.IMAGE_NAME }} | |
| layers: true | |
| tags: ${{ steps.setup-tags.outputs.build-tags }} | |
| - name: 'Push to GHCR' | |
| uses: redhat-actions/push-to-registry@5ed88d269cf581ea9ef6dd6806d01562096bee9c # v2.8 | |
| env: | |
| REGISTRY_USER: ${{ github.actor }} | |
| REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| image: ${{ steps.build-image.outputs.image }} | |
| tags: ${{ steps.build-image.outputs.tags }} | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ env.REGISTRY_USER }} | |
| password: ${{ env.REGISTRY_PASSWORD }} |