test parallel deploy

This commit is contained in:
neil 2022-10-17 20:41:51 +08:00
parent ec3e15c120
commit 843396391e

View file

@ -8,79 +8,19 @@ env:
TEA_SECRET: ${{ secrets.TEA_SECRET }} TEA_SECRET: ${{ secrets.TEA_SECRET }}
jobs: jobs:
deploy: deploy_sls:
runs-on: ubuntu-latest runs-on: ubuntu-latest
defaults:
run:
working-directory: ./lambdas
steps: steps:
# - name: inject slug/short variables
# uses: rlespinasse/github-slug-action@v3.x
# - name: Set STAGE variable in environment for next steps
# run: echo "STAGE=pr-${{ github.event.number }}-${{ env.GITHUB_HEAD_REF_SLUG }}" >> $GITHUB_ENV
# - name: Create Deployment
# uses: bobheadxi/deployments@v1
# id: deployment
# with:
# step: start
# env: ${{ env.STAGE }}
# ref: ${{ github.head_ref }}
# override: true
# - uses: actions/checkout@v3
# - name: Apply Staging Configuration
# run: |
# sed -i -e 's/^baseURL\s*=.*$/baseUrl = ""/i' config.toml
# echo "relativeurls = true" >>config.toml
# working-directory: src
# - name: Copy packages.json summary from dist.tea.xyz
# uses: prewk/s3-cp-action@v2
# with:
# aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
# aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# source: 's3://dist.tea.xyz/mock_packages.json'
# dest: './src/data/packages.json'
# - name: Create Package Detail Pages from packages.json
# uses: getneil/jq-action@v1
# id: version
# with:
# cmd: '.github/build-package-pages.sh src/data/packages.json src/content/packages'
# - run: .github/mk-pantry-accessible.sh ${{ secrets.TEMP_JACOBS_GITHUB_PAT }}
# - uses: teaxyz/setup@v0
# with:
# target: build
# - name: Check for broken links
# uses: lycheeverse/lychee-action@v1
# with:
# fail: true
# args: --verbose --no-progress './public/**/*.md' './public/**/*.html'
# env:
# GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
# - uses: actions/setup-node@v3
# with:
# node-version: 14
# - uses: bahmutov/npm-install@v1
# with:
# working-directory: .cdk
- uses: aws-actions/configure-aws-credentials@v1 - uses: aws-actions/configure-aws-credentials@v1
with: with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1 aws-region: us-east-1
# - name: Deploy to AWS
# id: cdk_deploy
# run: yarn deploy
# working-directory: .cdk
- uses: borales/actions-yarn@v3.0.0 - uses: borales/actions-yarn@v3.0.0
working-directory: ./lambdas
with: with:
cmd: install cmd: install
@ -90,12 +30,83 @@ jobs:
with: with:
args: --stage prod deploy args: --stage prod deploy
# - name: Seal Deployment # deploy:
# uses: bobheadxi/deployments@v1 # runs-on: ubuntu-latest
# if: always() # steps:
# with: # - name: inject slug/short variables
# step: finish # uses: rlespinasse/github-slug-action@v3.x
# status: ${{ job.status }} # - name: Set STAGE variable in environment for next steps
# deployment_id: ${{ steps.deployment.outputs.deployment_id }} # run: echo "STAGE=pr-${{ github.event.number }}-${{ env.GITHUB_HEAD_REF_SLUG }}" >> $GITHUB_ENV
# env: ${{ env.STAGE }}
# env_url: ${{ steps.cdk_deploy.outputs.env_url }} # - name: Create Deployment
# uses: bobheadxi/deployments@v1
# id: deployment
# with:
# step: start
# env: ${{ env.STAGE }}
# ref: ${{ github.head_ref }}
# override: true
# - uses: actions/checkout@v3
# - name: Apply Staging Configuration
# run: |
# sed -i -e 's/^baseURL\s*=.*$/baseUrl = ""/i' config.toml
# echo "relativeurls = true" >>config.toml
# working-directory: src
# - name: Copy packages.json summary from dist.tea.xyz
# uses: prewk/s3-cp-action@v2
# with:
# aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }}
# aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# source: 's3://dist.tea.xyz/mock_packages.json'
# dest: './src/data/packages.json'
# - name: Create Package Detail Pages from packages.json
# uses: getneil/jq-action@v1
# id: version
# with:
# cmd: '.github/build-package-pages.sh src/data/packages.json src/content/packages'
# - run: .github/mk-pantry-accessible.sh ${{ secrets.TEMP_JACOBS_GITHUB_PAT }}
# - uses: teaxyz/setup@v0
# with:
# target: build
# - name: Check for broken links
# uses: lycheeverse/lychee-action@v1
# with:
# fail: true
# args: --verbose --no-progress './public/**/*.md' './public/**/*.html'
# env:
# GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
# - uses: actions/setup-node@v3
# with:
# node-version: 14
# - uses: bahmutov/npm-install@v1
# with:
# working-directory: .cdk
# - 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: Deploy to AWS
# id: cdk_deploy
# run: yarn deploy
# working-directory: .cdk
# - name: Seal Deployment
# uses: bobheadxi/deployments@v1
# if: always()
# with:
# step: finish
# status: ${{ job.status }}
# deployment_id: ${{ steps.deployment.outputs.deployment_id }}
# env: ${{ env.STAGE }}
# env_url: ${{ steps.cdk_deploy.outputs.env_url }}