forked from edgargaticaCU/kgx-export
-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (59 loc) · 1.65 KB
/
ci.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
name: Project Tests
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
PROJECT_ID: ${{ secrets.GCE_PROJECT }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Test with pytest
run: python -m pytest -vv tests/TestTargeted.py tests/TestServices.py
build_kgx_export_container:
name: "build/push kgx-export container"
runs-on: ubuntu-latest
env:
DOCKERFILE: Dockerfile
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- id: 'auth'
uses: 'google-github-actions/auth@v2'
with:
project_id: ${{ secrets.GCE_PROJECT }}
service_account: ${{ secrets.SERVICE_ACCOUNT }}
credentials_json: ${{ secrets.SERVICE_ACCOUNT_KEY }}
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v2'
with:
version: '>= 363.0.0'
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Configure Docker Authentication
run: |
gcloud --quiet auth configure-docker
- name: Build Docker Image
run: |
docker build --tag "gcr.io/$PROJECT_ID/kgx-export" \
-f ${{ env.DOCKERFILE }} .
- name: Publish Docker Image to Google Container Registry
run: |
docker push "gcr.io/$PROJECT_ID/kgx-export"
timeout-minutes: 15