Skip to content

v2.5.6

v2.5.6 #52

name: "🧶 Deploy to Prod 🐈"
on:
release:
types: [published]
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/investigations-client:${{ env.version_name }}" \
--build-arg NEXT_PUBLIC_API_URL=https://api-investigations.rubinobs.org/api \
--build-arg NEXT_PUBLIC_BASE_URL=https://investigations.rubinobservatory.org \
--build-arg NEXT_PUBLIC_GOOGLE_APP_ID=596747551410-e6v1s01riph83i8003impi1fhgomlag5.apps.googleusercontent.com \
--build-arg GOOGLE_APP_SECRET=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 \
--build-arg CRAFT_SECRET_TOKEN=1128f3c472c118caa63 \
--build-arg CRAFT_EDUCATOR_SCHEMA_SECRET_TOKEN=KPYySxz0TZjIPAtNCdnYUkguZz6y6BU- \
--build-arg CRAFT_STUDENT_SCHEMA_SECRET_TOKEN=vPNHdjzu4XwKhiYC0jDrQENzGxb2Ltx3 \
--build-arg NEXT_PUBLIC_PLAUSIBLE_DOMAIN=investigations.rubinobservatory.org,rubinobservatory.org,all.epo.sites \
.
- name: Configure Docker Auth
run: gcloud --quiet auth configure-docker
- name: Push Container Image to GCR
run: docker push gcr.io/edc-prod-eef0/investigations-client:${{ env.version_name }}
- name: Get app.yaml
run: gcloud secrets versions access latest --secret=investigations-client-appyaml > app.yaml
- name: Deploy to App Engine
run: |-
gcloud app deploy app.yaml \
--image-url=gcr.io/edc-prod-eef0/investigations-client:${{ env.version_name }} \
--version=${{ env.version_name }} \
--promote \
--project=edc-prod-eef0