v1.1.0 #25
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: Publish Docker image | |
on: | |
release: | |
types: [published] | |
workflow_dispatch: | |
push: | |
branches: | |
# Note: this cannot be "ci/" because docker complains about the name | |
# when it tries to make the image name | |
- ci-* | |
env: | |
image_name: orcacollective/techbloc-airflow | |
jobs: | |
push_to_registry: | |
name: Push Docker image to GitHub Packages | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
contents: read | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: extractions/setup-just@v1 | |
- name: Get python version | |
run: echo "PROJECT_PY_VERSION=$(just py-version)" >> $GITHUB_ENV | |
- name: Get airflow version | |
run: echo "PROJECT_AIRFLOW_VERSION=$(just airflow-version)" >> $GITHUB_ENV | |
- name: Log in to GitHub Docker Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: https://ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push image | |
uses: docker/build-push-action@v4 | |
with: | |
push: true | |
build-args: | | |
PROJECT_PY_VERSION=${{ env.PROJECT_PY_VERSION }} | |
PROJECT_AIRFLOW_VERSION=${{ env.PROJECT_AIRFLOW_VERSION }} | |
tags: | | |
ghcr.io/${{ env.image_name }}:${{ github.sha }} | |
ghcr.io/${{ env.image_name }}:${{ github.ref_name }} | |
ghcr.io/${{ env.image_name }}:latest |