-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (66 loc) · 2.43 KB
/
artifact.yaml
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
75
76
77
78
name: Build and Push to Artifact Registry
"on":
push:
branches: ["dev", "szsz-code-cleanup"]
tags: ["v*"]
env:
PROJECT_ID: open-targets-genetics-dev
REGION: europe-west1
GAR_LOCATION: europe-west1-docker.pkg.dev/open-targets-genetics-dev
REPOSITORY: ot-orchestration
PYTHON_VERSION_DEFAULT: "3.10"
# Add "id-token" with the intended permissions.
jobs:
build-push-artifact:
permissions:
contents: "read"
id-token: "write"
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: "actions/checkout@v3"
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION_DEFAULT }}
- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true
- id: auth
name: Authenticate with Google Cloud
uses: google-github-actions/auth@v2
with:
project_id: ${{ env.PROJECT_ID }}
#NOTE: created with https://gist.github.com/javfg#how-to-push-tagged-docker-releases-to-google-artifact-registry-with-a-github-action
workload_identity_provider: projects/234703259993/locations/global/workloadIdentityPools/github/providers/my-provider
service_account: github-actions-access@open-targets-genetics-dev.iam.gserviceaccount.com
- name: "Set up Cloud SDK"
uses: "google-github-actions/setup-gcloud@v2"
- name: "Use gcloud CLI"
run: "gcloud info"
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: "Docker auth"
run: |
gcloud auth configure-docker ${{ env.REGION }}-docker.pkg.dev --quiet
- name: Build ot package with poetry
run: |
poetry install
poetry build --format wheel
- name: Get distribution file
run: |
echo "DIST=$(find dist -name 'ot_orchestration*')" >> $GITHUB_ENV
- name: Build and push gentropy image
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
push: true
tags: "${{ env.GAR_LOCATION }}/${{ env.REPOSITORY }}/genetics_etl:${{ github.ref_name }}"
context: .
file: images/genetics_etl/Dockerfile
build-args: DIST=${{ env.DIST }}