updated reference to dockerfile for GHCR builts #5
Workflow file for this run
This file contains 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: Docker Image CI pushing to GHCR for testing | |
on: | |
push: | |
branches: [ "dev_benste" ] | |
pull_request: | |
branches: [ "dev_benste"] | |
env: | |
GHCR_REGISTRY: ghcr.io | |
GHCR_USERNAME: ${{ github.actor }} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Version from Python | |
run: echo "VERSION=$(python3 -c 'import versions; print(versions.VERSION)')" >> $GITHUB_ENV | |
- name: SHA_short | |
run: echo "GITHUB_SHA_SHORT=$(echo $GITHUB_SHA | cut -c 1-6)" >> $GITHUB_ENV | |
- name: Show detected version number | |
run: echo $VERSION | |
- name: Login to GHCR | |
uses: docker/login-action@v1 | |
with: | |
registry: ${{ env.GHCR_REGISTRY }} | |
username: ${{ env.GHCR_USERNAME }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and Push Docker Image | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: Dockerfile | |
push: true | |
tags: ${{ env.GHCR_REGISTRY }}/bensteuem/church_web_helper:${{ env.GITHUB_SHA_SHORT }} | |
build-args: VERSION=${{ env.VERSION }} | |
env: | |
username: ${{ env.GHCR_USERNAME }} | |
CR_PAT: ${{ secrets.CR_PAT }} |