-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (74 loc) · 3.25 KB
/
release.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
79
80
81
82
83
84
85
---
name: Release
concurrency: opa-release
on:
release:
types:
- published
permissions:
contents: read
id-token: write
jobs:
publish:
name: Build and publish docker container to gcr.io and dockerhub
runs-on: ubuntu-latest
env:
ARTIFACT_REGISTRY_URL: europe-west1-docker.pkg.dev
GCP_PROJECT_ID_MGMT: ${{ secrets.GCP_PROJECT_ID_MGMT }}
GCR_URL: gcr.io # TODO remove after migration
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }} # TODO remove after migration
DOCKER_BUILDKIT: 1
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup ENV variables
run: |
echo "NOW=$(date -u +%Y-%m-%dT%H:%M:%S)" >> $GITHUB_ENV
echo "SHORT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
echo "VERSION=${{ github.event.release.tag_name }}" >> $GITHUB_ENV
- name: Authenticate to Google Cloud
id: auth
uses: google-github-actions/auth@v1
with:
workload_identity_provider: projects/699926043561/locations/global/workloadIdentityPools/github-dev/providers/github-dev-provider
service_account: [email protected]
- name: Configure Docker
run: |-
gcloud --quiet auth configure-docker
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PAT }}
- name: Build, Tag and Push docker images
run: |
make opa-ci
# TODO replace the block above with this after switching to indykite-dev
- name: Authenticate to Google Cloud
id: authentication
uses: google-github-actions/auth@v2
with:
workload_identity_provider: 'projects/581343830490/locations/global/workloadIdentityPools/github-mgmt/providers/github-mgmt-provider'
service_account: "github@${{ env.GCP_PROJECT_ID_MGMT }}.iam.gserviceaccount.com"
- name: Configure Docker
run: |
gcloud auth configure-docker $ARTIFACT_REGISTRY_URL -q
- name: Build, Tag and Push docker images
run: |
make opa-ci-new
- name: Check out notifier action repo
uses: actions/checkout@v4
with:
ref: master
repository: indykite/notifier-action
path: notifier-action
token: ${{ secrets.INDYKITEONE_PAT }}
- name: Trigger new OPA test image build
uses: ./notifier-action/
with:
image_tag: ${{ env.SHORT_SHA }}
token: ${{ secrets.INDYKITEONE_PAT }}
owner: indykite
repo: jarvis-opa-test
workflow_id: dev-build-test-opa.yaml
ref: master