Skip to content

v0.1.0-alpha

v0.1.0-alpha #1

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/skyviewer-client:${{ env.version_name }}" \
--build-arg NEXT_PUBLIC_API_URL=https://skyviewer-api-dot-edc-prod-eef0.uc.r.appspot.com/api \
--build-arg NEXT_PUBLIC_BASE_URL=https://skyviewer-client-dot-edc-prod-eef0.uc.r.appspot.com \
--build-arg CRAFT_SECRET_TOKEN=abcdef0123456789 \
--build-arg NEXT_PUBLIC_ASSETS_BASE_URL=https://skyviewer-api-dot-edc-prod-eef0.uc.r.appspot.com/assets \
--build-arg NEXT_PUBLIC_ASTRO_API_URL=https://us-central1-skyviewer.cloudfunctions.net/astro-objects-api \
.
- 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=skyviewer-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