Skip to content

Merge branch 'develop' into test #41

Merge branch 'develop' into test

Merge branch 'develop' into test #41

Workflow file for this run

name: Dev build image & push
on:
push:
branches: [ test ]
jobs:
build:
name: Dockerize dbt
runs-on: ubuntu-latest
steps:
# actions/checkout MUST come before auth
- name: Checkout
uses: actions/checkout@v2
- id: auth
name: Authenticate with Google Cloud
uses: "google-github-actions/auth@v1"
with:
token_format: access_token
project_id: ${{ vars.DBT_BIGQUERY_PROJECT_ID }}
credentials_json: ${{ secrets.KEYFILE_CONTENTS }}
access_token_lifetime: 300s
- name: Login to Artifact Registry
uses: docker/login-action@v1
with:
registry: us-central1-docker.pkg.dev
username: oauth2accesstoken
password: ${{ steps.auth.outputs.access_token }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Get tag
id: get-tag
run: echo ::set-output name=short_ref::${GITHUB_REF#refs/*/}
- name: Build & Push Image
uses: docker/build-push-action@v4
with:
context: ./silverwork_dbt
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ secrets.DBT_REGISTRY_ENDPOINT }}:${{ steps.get-tag.outputs.short_ref }}
${{ secrets.DBT_REGISTRY_ENDPOINT }}:latest
# - name: Trigger Airflow init dag
# env:
# AIRFLOW_WEBSERVER_ENDPOINT: ${{ secrets.AIRFLOW_WEBSERVER_ENDPOINT }}
# AIRFLOW_WEBSERVER_ID: ${{ secrets.AIRFLOW_WEBSERVER_ID }}
# AIRFLOW_WEBSERVER_PASSWORD: ${{ secrets.AIRFLOW_WEBSERVER_PASSWORD }}
# AIRFLOW_DBT_INIT_DAG_ID: ${{ secrets.AIRFLOW_DBT_INIT_DAG_ID }}
# shell: bash
# run: |
# curl "$AIRFLOW_WEBSERVER_ENDPOINT/api/v1/dags/$AIRFLOW_DBT_INIT_DAG_ID/dagRuns" --user "$AIRFLOW_WEBSERVER_ID:$AIRFLOW_WEBSERVER_PASSWORD" -H 'Content-Type: application/json' -d '{}'