-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (56 loc) · 2.52 KB
/
prod-push.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
name: 'Deploy to Prod'
on:
push:
branches:
- '!*'
tags:
- 'v*'
jobs:
build-push-deploy:
name: 'Build and Deploy to Production'
runs-on: ubuntu-latest
# Checkout the repository to the GitHub Actions runner
steps:
- name: Checkout
uses: actions/checkout@v2
# gcloud CLI setup
- name: Login to GCP
uses: google-github-actions/setup-gcloud@v0
with:
service_account_key: ${{ secrets.PIPELINE_EPO_PROD_PROJECT }}
project_id: edc-prod-eef0
export_default_credentials: true
- name: Format version name
id: version_name
run: echo "version_name=$(echo \"${{ github.ref_name }}\" | sed 's/[_.,\/]/-/g' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
- name: Build Container Image
run: |-
docker build \
-t "gcr.io/edc-prod-eef0/rubin-obs-client:${{ env.version_name }}" \
--build-arg NEXT_PUBLIC_API_URL=https://api.rubinobs.org/api \
--build-arg NEXT_PUBLIC_BASE_URL=https://rubinobservatory.org \
--build-arg EDC_LOGGER_API_URL=https://us-central1-skyviewer.cloudfunctions.net/edc-logger \
--build-arg NEXT_PUBLIC_DEBUG_LOGGING=false \
--build-arg CLOUD_ENV=PROD \
--build-arg NEXT_PUBLIC_GOOGLE_APP_ID=596747551410-vcqlrp7erg5c5gm0dkvc0k21mgi0ilg0.apps.googleusercontent.com \
--build-arg NEXT_PUBLIC_CONTACT_FORM_POST_URL=https://api.rubinobs.org/actions/contact-form/send \
--build-arg NEXT_PUBLIC_PLAUSIBLE_DOMAIN=rubinobservatory.org,all.epo.sites \
--build-arg NEXT_PREVIEW_SLUG=preview-in-craft-cms \
--build-arg NEXT_PUBLIC_EFD_URL=https://hasura-e3g4rcii3q-uc.a.run.app/v1/graphql \
--build-arg NEXT_PUBLIC_HASURA_SECRET=_qfq_tMbyR4brJ@KHCzuJRU7 \
--build-arg NEXT_PUBLIC_RELEASE_URL=`https://noirlab.edu/public/api/v2/releases/{{ID}}/?lang={{SITE}}&translation_mode=fallback` \
--build-arg NEXT_PUBLIC_SURVEY_SPARROW=true \
.
- name: Configure Docker Auth
run: gcloud --quiet auth configure-docker
- name: Push Container Image to GCR
run: docker push gcr.io/edc-prod-eef0/rubin-obs-client:${{ env.version_name }}
- name: Get app.yaml
run: gcloud secrets versions access latest --secret=rubin-obs-client-appyaml > app.yaml
- name: Deploy to App Engine
run: |-
gcloud app deploy app.yaml \
--image-url=gcr.io/edc-prod-eef0/rubin-obs-client:${{ env.version_name }} \
--version=${{ env.version_name }} \
--promote \
--project=edc-prod-eef0