Skip to content

Commit

Permalink
test deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
gracia10 committed Jun 30, 2023
1 parent 267db94 commit 5c9fa3e
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Dev build image & push

on:
push:
branches: [ test ]

env:
working-directory: silverwork_dbt

jobs:
build:
name: install and build dbt
runs-on: ubuntu-latest

steps:
# actions/checkout MUST come before auth
- name: Checkout Repo
uses: actions/checkout@v2

- name: Setup auth
id: "auth"
uses: "google-github-actions/auth@v1"
with:
project_id: ${{ vars.DBT_BIGQUERY_PROJECT_ID }}
credentials_json: ${{secrets.KEYFILE_CONTENTS}}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Build & Push Image
uses: docker/build-push-action@v2
with:
context: ${{ github.workspace }}
push: true
tags: ${{ secrets.DBT_REGISTRY_ENDPOINT }}:${{ secrets.DBT_REGISTRY_VERSION }}
cache-from: type=gha
cache-to: type=gha,mode=max

# - 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 '{}'
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# 베이스 이미지 선택
FROM python:3.9-slim-buster

# 작업 디렉토리 설정
WORKDIR /app

# 필요한 파일 복사
COPY silverwork_dbt/ /app/silverwork_dbt/

# 의존성 설치
RUN pip install dbt-snowflake pandas

0 comments on commit 5c9fa3e

Please sign in to comment.