Skip to content

updated login references and version varibale #25 #20

updated login references and version varibale #25

updated login references and version varibale #25 #20

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: Set up Python
uses: actions/[email protected]
with:
python-version: 3.x
- name: Install Poetry
run: |
pip install poetry
poetry config virtualenvs.create false # Skip creating a virtual environment
env:
POETRY_HOME: ${{ github.workspace }}/.poetry
- name: Install project dependencies
run: |
poetry install
env:
POETRY_HOME: ${{ github.workspace }}/.poetry
- 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 }}