-
Notifications
You must be signed in to change notification settings - Fork 13
80 lines (67 loc) · 2.76 KB
/
prod.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
# .github/workflows/staging.yml
#
# GitHub Action for Serverless NextJS staging environment
#
name: Deploy prod-steedos-website
on:
push:
tags: # Deploy tag (e.g. v1.0) to production
- 'v**'
jobs:
deploy-staging:
runs-on: ubuntu-latest
environment: prod
env:
STEEDOS_SERVER_API_KEY: ${{ secrets.STEEDOS_SERVER_API_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
NEXT_PUBLIC_DEPLOYMENT_URL: https://www.steedos.com
NEXT_PUBLIC_STEEDOS_ROOT_URL: https://console.steedos.cn
NEXT_STATIC_PROPS_REVALIDATE: 3600
KEYCLOAK_ID: www.steedos.cn
KEYCLOAK_SECRET: ${{ secrets.KEYCLOAK_SECRET }}
KEYCLOAK_ISSUER: https://id.steedos.cn/realms/master
NEXT_PUBLIC_NEXTAUTH_PROVIDER_ID: keycloak
NEXTAUTH_URL: https://www.steedos.com
NEXTAUTH_SECRET: ${{ secrets.NEXTAUTH_SECRET }}
STEEDOS_IDENTITY_JWT_SECRET: ${{ secrets.STEEDOS_IDENTITY_JWT_SECRET }}
steps:
- uses: actions/checkout@v2
# - name: Configure AWS Credentials
# uses: aws-actions/configure-aws-credentials@v1
# with:
# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# aws-region: ap-east-1
- name: Download `.serverless` state from S3
run: aws s3 sync s3://steedos-serverless-state-bucket/steedos.com.cn/prod/.serverless .serverless --delete --region ap-east-1
- uses: canastro/copy-file-action@master
with:
source: 'serverless-prod.yml'
target: 'serverless.yml'
- name: Use Node.js '14'
uses: actions/setup-node@v2
with:
node-version: '14'
cache: "yarn"
- run: yarn --frozen-lockfile
- name: Serverless AWS authentication
run: npx [email protected] --component=serverless-next config credentials --provider aws --key ${{ secrets.AWS_ACCESS_KEY_ID }} --secret ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Deploy to AWS
run: npx [email protected]
- name: Upload `.serverless` state to S3
run: aws s3 sync .serverless s3://steedos-serverless-state-bucket/steedos.com.cn/prod/.serverless --delete --region ap-east-1
# build-algolia:
# runs-on: ubuntu-latest
# needs: deploy-staging
# env:
# ALGOLIA_APP_ID: TL0K9Y2YIH
# ALGOLIA_ADMIN_API_KEY: ${{ secrets.ALGOLIA_ADMIN_API_KEY }}
# steps:
# - uses: actions/checkout@v2
# - name: Build algolia
# uses: darrenjennings/algolia-docsearch-action@master
# with:
# algolia_application_id: 'TL0K9Y2YIH'
# algolia_api_key: ${{ secrets.ALGOLIA_ADMIN_API_KEY }}
# file: 'docsearch-config.json'