-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (58 loc) · 2.49 KB
/
preview.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
# GitHub Action for Serverless NextJS staging environment
name: Deploy as4-preview
on:
workflow_dispatch:
push:
branches: [preview]
jobs:
deploy-preview:
name: deploy-preview
environment: Preview
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x]
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: us-east-1
- name: Copy serverless-preview.yml to serverless.yml
uses: canastro/copy-file-action@master
with:
source: "serverless-preview.yml"
target: "serverless.yml"
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies (with --force)
run: npm ci --force
- 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]
env:
ADMIN_EMAIL: ${{ secrets.ADMIN_EMAIL }}
AUTH_SECRET: ${{ secrets.AUTH_SECRET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
DB_NAME: ${{ secrets.DB_NAME }}
EMAIL_SERVER_USER: ${{ secrets.EMAIL_SERVER_USER }}
EMAIL_SERVER_PASSWORD: ${{ secrets.EMAIL_SERVER_PASSWORD }}
EMAIL_SERVER_HOST: ${{ secrets.EMAIL_SERVER_HOST }}
EMAIL_SERVER_PORT: ${{ secrets.EMAIL_SERVER_PORT }}
EMAIL_FROM: ${{ secrets.EMAIL_FROM }}
MONGODB_URI: ${{ secrets.MONGODB_URI }}
NEXT_PUBLIC_IDEA_SPACE_ENABLED: ${{ secrets.NEXT_PUBLIC_IDEA_SPACE_ENABLED }}
NEXT_PUBLIC_LOGO_SVG: ${{ secrets.NEXT_PUBLIC_LOGO_SVG }}
NEXT_PUBLIC_SIGNING_URL: ${{ secrets.NEXT_PUBLIC_SIGNING_URL }}
NEXT_PUBLIC_SITE_NAME: ${{ secrets.NEXT_PUBLIC_SITE_NAME }}
NEXT_PUBLIC_TINYMCE_API_KEY: ${{ secrets.NEXT_PUBLIC_TINYMCE_API_KEY }}
NEXTAUTH_URL: ${{ secrets.NEXTAUTH_URL }}
SITE: ${{ secrets.SITE }}
SITE_NAME: ${{ secrets.SITE_NAME }}
SUPPORT_EMAIL: ${{ secrets.SUPPORT_EMAIL }}