This repository has been archived by the owner on Dec 4, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 3
85 lines (73 loc) · 2.55 KB
/
google.yml
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
# This workflow will deploy to Google Cloud Functions
#
# To configure this workflow, set up the following secrets in your workspace
#
# * `GH_APP_IDENTIFIER` - GitHub App identifier
# * `GH_APP_PRIVATE_KEY` - GitHub App private key
# * `GOOGLE_SERVICE_ACCOUNT_EMAIL` - Google service account email
# * `GOOGLE_APPLICATION_CREDENTIALS` - Google service account private key
# * `GH_WEBHOOK_SECRET` - GitHub webhook secret to confirm that webhooks come from GitHub
name: Deploy
on:
push:
branches:
- master
jobs:
build-deploy:
name: google
runs-on: ubuntu-latest
env:
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
GH_APP_SECRET_KEY: ${{ secrets.GH_APP_SECRET_KEY }}
GH_APP_IDENTIFIER: ${{ secrets.GH_APP_IDENTIFIER }}
GH_WEBHOOK_SECRET: ${{ secrets.GH_WEBHOOK_SECRET }}
SENTRY_WEBPACK_WEBHOOK_SECRET: ${{ secrets.SENTRY_WEBPACK_WEBHOOK_SECRET }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup node
uses: actions/setup-node@v1
with:
node-version: '12'
- name: yarn install
run: |
echo "$(yarn global bin)" >> $GITHUB_PATH
yarn install --frozen-lockfile
yarn global add @sentry/cli
- name: test
run: yarn test
- name: Get version
id: get-version
run: echo "::set-output name=version::$(sentry-cli releases propose-version)"
# Build ts
- name: Build
run: |
yarn build
# Setup gcloud CLI
- name: Setup gcloud CLI
uses: google-github-actions/setup-gcloud@v0
with:
service_account_email: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_EMAIL }}
service_account_key: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
# Deploy to Google Cloud Functions
- name: Deploy
id: deploy
env:
VERSION: ${{ steps.get-version.outputs.version }}
run: |
echo "::set-output name=deploy-start::$(date +%s)"
bin/deploy.sh
- name: Sentry Release
env:
VERSION: ${{ steps.get-version.outputs.version }}
DEPLOY_START: ${{ steps.deploy.outputs.deploy-start }}
run: |
echo "$VERSION"
now=$(date +%s)
sentry-cli releases new "$VERSION"
sentry-cli releases set-commits "$VERSION" --auto
sentry-cli releases files "$VERSION" upload-sourcemaps './lib'
sentry-cli releases deploys "$VERSION" new -e production -t $((now-DEPLOY_START))
sentry-cli releases finalize "$VERSION"