Merge pull request #2 from OpenTechIL/develop #3
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 and Push to GHCR | |
| on: | |
| push: | |
| branches: | |
| - release | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| packages: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| # Create a lowercase version of the repository name | |
| - name: Set lower case owner and repo | |
| run: | | |
| echo "REPO_LOWER=${GITHUB_REPOSITORY,,}" >> ${GITHUB_ENV} | |
| - name: Bump version and push tag | |
| id: tagger | |
| uses: mathieudutour/github-tag-action@v6.2 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| tag_prefix: "v" | |
| - name: Log in to GHCR | |
| uses: redhat-actions/podman-login@v1 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build Image | |
| id: build_image | |
| uses: redhat-actions/buildah-build@v2 | |
| with: | |
| image: ghcr.io/${{ env.REPO_LOWER }} | |
| tags: | | |
| ${{ steps.tagger.outputs.new_tag }} | |
| latest | |
| context: . | |
| containerfiles: ./Dockerfile | |
| - name: Push to GHCR | |
| uses: redhat-actions/push-to-registry@v2 | |
| with: | |
| tags: ${{ steps.build_image.outputs.tags }} |