Deploy to GCP (#2327)
This commit is contained in:
parent
6738467304
commit
781eafa68e
1 changed files with 51 additions and 0 deletions
51
.github/workflows/deploy-gcp.yml
vendored
Normal file
51
.github/workflows/deploy-gcp.yml
vendored
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
name: Deploy to GCP
|
||||||
|
on:
|
||||||
|
repository_dispatch:
|
||||||
|
types: gcp-deployment
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-20.04
|
||||||
|
env:
|
||||||
|
API_URI: /graphql/
|
||||||
|
APP_MOUNT_URI: /dashboard/
|
||||||
|
STATIC_URL: /dashboard/static/
|
||||||
|
SENTRY_ORG: saleor
|
||||||
|
SENTRY_PROJECT: dashboard
|
||||||
|
SENTRY_URL_PREFIX: "~/dashboard/static"
|
||||||
|
ENVIRONMENT: ${{ github.event.client_payload.deployment_name }}
|
||||||
|
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
|
||||||
|
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||||
|
IS_CLOUD_INSTANCE: true
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
ref: ${{ github.event.client_payload.ref }}
|
||||||
|
- name: Package
|
||||||
|
timeout-minutes: 15
|
||||||
|
run: |
|
||||||
|
npm ci
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
npm run build
|
||||||
|
- uses: google-github-actions/auth@v0
|
||||||
|
with:
|
||||||
|
credentials_json: ${{ secrets.GCP_DASHBOARD_PROD_PRIVATE_KEY }}
|
||||||
|
- name: Set up Cloud SDK
|
||||||
|
uses: google-github-actions/setup-gcloud@v0
|
||||||
|
- name: Deploy
|
||||||
|
run: |
|
||||||
|
gcloud storage cp -r build/dashboard/* gs://saleor-cloud-eu-dashboard/${ENVIRONMENT}/static/
|
||||||
|
gcloud storage cp build/dashboard/index.html gs://saleor-cloud-eu-dashboard/${ENVIRONMENT}/index.html
|
||||||
|
|
||||||
|
gcloud compute url-maps invalidate-cdn-cache saleor-cloud-eu --path "/dashboard" --async
|
||||||
|
gcloud compute url-maps invalidate-cdn-cache saleor-cloud-eu --path "/dashboard/*" --async
|
||||||
|
- name: Notify Slack
|
||||||
|
if: ${{ always() }}
|
||||||
|
env:
|
||||||
|
JOB_DEPLOYMENT_KIND: production
|
||||||
|
JOB_STATUS: ${{ job.status }}
|
||||||
|
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CLOUD_DEPLOYMENTS_WEBHOOK_URL }}
|
||||||
|
JOB_TITLE: "Dashboard deployment to ${{ env.ENVIRONMENT }}"
|
||||||
|
run: |
|
||||||
|
python3 ./.github/workflows/notify/notify-slack.py
|
Loading…
Reference in a new issue