Skip to content

Merge pull request #211 from steedos/master #255

Merge pull request #211 from steedos/master

Merge pull request #211 from steedos/master #255

Workflow file for this run

# .github/workflows/staging.yml
#
# GitHub Action for Serverless NextJS staging environment
#
name: Deploy beta-steedos-website
on:
push:
branches: [beta]
jobs:
deploy-staging:
runs-on: ubuntu-latest
environment: beta
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://beta.steedos.cn
NEXT_PUBLIC_STEEDOS_ROOT_URL: https://console.steedos.cn
NEXT_STATIC_PROPS_REVALIDATE: 60
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://beta.steedos.cn
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/beta/.serverless .serverless --delete --region ap-east-1
- uses: canastro/copy-file-action@master
with:
source: 'serverless-beta.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/beta/.serverless --delete --region ap-east-1