Merge pull request #15 from bensteUEM/bensteUEM/issue14 #9
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 stable release | |
on: | |
push: | |
branches: [ "master" ] | |
pull_request: | |
branches: [ "master"] | |
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 "VVERSION=$(python3 ./version.py)" >> $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:latest | |
build-args: VERSION=${{ env.VERSION }} | |
env: | |
username: ${{ env.GHCR_USERNAME }} | |
CR_PAT: ${{ secrets.CR_PAT }} |