-
Notifications
You must be signed in to change notification settings - Fork 2
74 lines (58 loc) · 1.94 KB
/
run-full-build.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
---
name: full-build
on:
push:
tags:
- "v20*"
branches:
- "*"
jobs:
build:
runs-on: ubuntu-latest
env:
API_KEY_GOOGLE_MAPS: ${{ secrets.API_KEY_GOOGLE_MAPS }}
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Who owns the workspace?
run: ls -ld $GITHUB_WORKSPACE
- uses: "google-github-actions/auth@v2"
with:
credentials_json: "${{ secrets.DGM_GITHUB_ACTION_CREDENTIALS }}"
- name: Display env variables
run: |
echo "Workspace directory: $GITHUB_WORKSPACE" \
echo "Google credentials path: $GOOGLE_GHA_CREDS_PATH" \
# Give the dbcp user ownership of the workspace
# So it can read and write files to the workspace
- name: Give the dbcp user ownership of the workspace
run: sudo chown -R 1000:1000 $GITHUB_WORKSPACE
- name: Set up Docker Compose
run: |
sudo apt-get update
sudo apt-get install -y docker-compose
- name: Build and run Docker Compose services
run: |
docker-compose up -d
- name: Run full ETL
run: |
make all
- name: Run all test
run: |
make test
- name: Publish publish outputs
if: (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')) || (github.ref_name == 'dev')
run: |
docker compose run --rm app python dbcp/publish.py --build-ref ${{ github.ref_name }}
- name: Stop Docker Compose services
if: always()
run: |
docker-compose down
# The google-github-actions/auth step is run as runner:docker,
# so we need to give the workspace back to runner:docker
- name: Give ownership of the workspace back to root
if: always()
run: sudo chown -R runner:docker $GITHUB_WORKSPACE
- name: Who owns the workspace?
if: always()
run: ls -ld $GITHUB_WORKSPACE