-
Notifications
You must be signed in to change notification settings - Fork 12
57 lines (53 loc) · 1.36 KB
/
deploy-dbt.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: 'Deploy DBT'
on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'dbt/**'
defaults:
run:
shell: bash
jobs:
tag:
runs-on: ubuntu-latest
outputs:
value: ${{ steps.set_tag.outputs.value }}
steps:
- id: set_tag
run: echo "value=$(date +'%F.%H%M')" >> $GITHUB_OUTPUT
build:
needs: tag
name: Build dbt tool
uses: ./.github/workflows/base-build-push-docker.yml
with:
name: dbt
context: ./dbt
tag: ${{ needs.tag.outputs.value }}
dockerfile: ./docker/dbt/prod/Dockerfile
secrets:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
deploy:
name: Deploy
needs: [tag, build]
runs-on: ubuntu-latest
steps:
- name: Trigger Workflow
uses: actions/github-script@v7
env:
TARGET_VERSION: ${{ needs.tag.outputs.value }}
with:
github-token: ${{ secrets.GA_PDC_TOKEN }}
script: |
github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: 'preuve-covoiturage-infra',
workflow_id: 'deploy.yml',
ref: 'main',
inputs: {
version: process.env.TARGET_VERSION,
image: 'dbt'
},
})