Skip to content

v3.4.3-alpha-07

v3.4.3-alpha-07 #169

Workflow file for this run

name: AWS CDK CD
on:
release:
types:
- created
env:
GITHUB_OAUTH_TOKEN: ${{ secrets.ACCESS_TOKEN_GITHUB }}
WEBSITE_DEV_PASS: ${{ secrets.WEBSITE_DEV_PASS }}
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
AWS_REGION: ${{ secrets.AWS_REGION }}
COGNITO_AFFILIATE_REGION: ${{ secrets.COGNITO_AFFILIATE_REGION }}
GOOGLE_OAUTH_CLIENT_ID: ${{ secrets.GOOGLE_OAUTH_CLIENT_ID }}
GOOGLE_OAUTH_CLIENT_SECRET: ${{ secrets.GOOGLE_OAUTH_CLIENT_SECRET }}
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
GOOGLE_API_SERVICE_ACCOUNT_INFO: ${{ secrets.GOOGLE_API_SERVICE_ACCOUNT_INFO }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_CHANNEL_ID: ${{ secrets.SLACK_CHANNEL_ID }}
SLACK_WORKSPACE_ID: ${{ secrets.SLACK_WORKSPACE_ID }}
BIT_TOKEN: ${{ secrets.BIT_TOKEN }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
DEPLOY_KEY: ${{ secrets.FEEDS_DEPLOY_PRIVATE_KEY }}
MASTER_VITE_GA_ID: ${{secrets.VITE_GA_ID}}
DEV_VITE_GA_ID: ${{secrets.DEV_VITE_GA_ID}}
STAGE: dev
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/install-deps
- name: Setup AWS
uses: Fooji/create-aws-profile-action@v2
with:
profile: default
region: ${{ env.AWS_REGION }}
key: ${{ secrets.AWS_ACCESS_KEY_ID }}
secret: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Deploy dev
if: github.event.release.prerelease == true
env:
STAGE: dev
run: cdk deploy --all --require-approval "never"
- name: Deploy prod
if: github.event.release.prerelease != true
env:
STAGE: prod
run: cdk deploy --all --require-approval "never"
update_doc:
runs-on: ubuntu-latest
needs: [deploy]
steps:
- uses: actions/checkout@v3
with:
repository: wasedatime/wasedatime.github.io
token: ${{ env.GITHUB_OAUTH_TOKEN }}
- name: Setup
run: |
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install --update
- name: Export
run: |
cd ./openapi
aws apigateway get-export --rest-api-id 'anvonkl0fd' --stage-name 'dev' --export-type 'swagger' --accepts 'application/yaml' ./dev.yml
aws apigateway get-export --rest-api-id 'anvonkl0fd' --stage-name 'prod' --export-type 'swagger' --accepts 'application/yaml' ./prod.yml
- name: Push
uses: EndBug/add-and-commit@v9
with:
author_name: GitHub Actions
author_email: [email protected]
add: "['./openapi/dev.yml', './openapi/prod.yml']"
branch: main
message: "API Documentation update from GitHub Actions"
push: true