Update python-publish.yml #6
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: Tag-triggered Containerization | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- "*" | |
env: | |
IMAGE_TAG: ${{ github.ref_name }} | |
IMAGE_SHA: ${{ github.sha }} | |
OC_REGISTRY: ghcr.io | |
REGISTRY_URL: "ghcr.io/freetakteam/ui" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
contents: read | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build the container image | |
# can this be converted to podman at some point to be more foss? | |
run: | | |
SANITIZED_TAG="$(echo ${IMAGE_TAG//[^[:alnum:]]/_} | tr '[:upper:]' '[:lower:]' )" | |
docker build . --file Dockerfile --tag $REGISTRY_URL:$SANITIZED_TAG --tag $REGISTRY_URL:latest --label "runnumber=${GITHUB_RUN_ID}" | |
- name: Log in to registry | |
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login $OC_REGISTRY -u $ --password-stdin | |
- name: Push image to registry | |
run: | | |
SANITIZED_TAG="$(echo ${IMAGE_TAG//[^[:alnum:]]/_} | tr '[:upper:]' '[:lower:]' )" | |
docker push $REGISTRY_URL:$SANITIZED_TAG | |
docker push $REGISTRY_URL:latest | |