Merge pull request #345 from mitaai/preview #145
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# GitHub Action for Serverless NextJS staging environment | |
name: Deploy as4-production | |
on: | |
workflow_dispatch: | |
push: | |
branches: [master] | |
jobs: | |
deploy-production: | |
name: deploy-production | |
environment: Production | |
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-prod.yml to serverless.yml | |
uses: canastro/copy-file-action@master | |
with: | |
source: "serverless-prod.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 }} |