feat: add containers and ci #2
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: PR Update | |
on: | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
permissions: | |
# read on both needed for changes detection | |
pull-requests: read | |
contents: read | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
changes: | |
# Detect which files have been changed on this PR's full history | |
uses: SwanseaUniversityMedical/workflows/.github/workflows/[email protected] | |
with: | |
slack-channel: ${{ vars.SLACK_CHANNEL }} | |
filters: | | |
base-container: | |
- './.github/workflows/on-pr-update.yaml' | |
- 'containers/airflow/base/**' | |
dags-container: | |
- './.github/workflows/on-pr-update.yaml' | |
- 'containers/airflow/dags/**' | |
- 'dags/**' | |
secrets: | |
slack-token: ${{ secrets.SLACK_TOKEN }} | |
base-container: | |
# Build the container and push it as :pr-42 and :pr-42-fe45b3h | |
needs: changes | |
if: fromJSON(needs.changes.outputs.changes).base-container == 'true' | |
uses: SwanseaUniversityMedical/workflows/.github/workflows/[email protected] | |
with: | |
job-name: base-container | |
container-registry: ${{ vars.HARBOR_REGISTRY }} | |
container-registry-user: ${{ vars.HARBOR_USER }} | |
container-registry-project: ${{ vars.HARBOR_PROJECT }} | |
container-registry-repo: airflow/base | |
slack-channel: ${{ vars.SLACK_CHANNEL }} | |
build-command: | | |
docker build -t $IMAGE -f containers/airflow/base/Dockerfile containers/airflow/base | |
secrets: | |
container-registry-token: ${{ secrets.HARBOR_TOKEN }} | |
slack-token: ${{ secrets.SLACK_TOKEN }} | |
dags-container: | |
# Build the container and push it as :pr-42 and :pr-42-fe45b3h | |
needs: changes | |
if: fromJSON(needs.changes.outputs.changes).dags-container == 'true' | |
uses: SwanseaUniversityMedical/workflows/.github/workflows/[email protected] | |
with: | |
job-name: dags-container | |
container-registry: ${{ vars.HARBOR_REGISTRY }} | |
container-registry-user: ${{ vars.HARBOR_USER }} | |
container-registry-project: ${{ vars.HARBOR_PROJECT }} | |
container-registry-repo: airflow/dags | |
slack-channel: ${{ vars.SLACK_CHANNEL }} | |
build-command: | | |
docker build -t $IMAGE -f containers/airflow/dags/Dockerfile containers/airflow/dags | |
secrets: | |
container-registry-token: ${{ secrets.HARBOR_TOKEN }} | |
slack-token: ${{ secrets.SLACK_TOKEN }} |