test build folder

This commit is contained in:
neil 2022-12-07 12:39:52 +08:00
parent 7345fe6a8a
commit 61d47bcf67

View file

@ -52,65 +52,65 @@ jobs:
- uses: teaxyz/setup@v0 - uses: teaxyz/setup@v0
with: with:
target: build target: build
- run: echo ./public/+github.com
# - 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}}
- name: Check for broken links # # update packages json data and rebuild again
uses: lycheeverse/lychee-action@v1 # - name: make images relative path to preview site
with: # uses: getneil/jq-action@v1
fail: true # with:
args: --verbose --no-progress './public/**/*.md' './public/**/*.html' # cmd: '.github/sync-thumb-images.sh src/data/packages.json'
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
# update packages json data and rebuild again # # intentional to rebuild packages again with relative image data
- name: make images relative path to preview site # # the first one to test it against prod resources via lychee
uses: getneil/jq-action@v1 # - uses: teaxyz/setup@v0
with: # with:
cmd: '.github/sync-thumb-images.sh src/data/packages.json' # target: build
# intentional to rebuild packages again with relative image data # - uses: actions/setup-node@v3
# the first one to test it against prod resources via lychee # with:
- uses: teaxyz/setup@v0 # node-version: 14
with: # - uses: bahmutov/npm-install@v1
target: build # with:
# working-directory: .cdk
- uses: actions/setup-node@v3 # - uses: aws-actions/configure-aws-credentials@v1
with: # with:
node-version: 14 # aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
- uses: bahmutov/npm-install@v1 # aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
with: # aws-region: us-east-1
working-directory: .cdk
- uses: aws-actions/configure-aws-credentials@v1 # - name: Deploy to AWS
with: # id: cdk_deploy
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} # run: yarn deploy
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} # working-directory: .cdk
aws-region: us-east-1
- name: Deploy to AWS # - name: get cdk bucket
id: cdk_deploy # id: DEPLOY_BUCKET
run: yarn deploy # run: |
working-directory: .cdk # BUCKET=$(aws s3 ls | grep $(echo teaxyz-pr-$GITHUB_REF_SLUG_URL | sed "s/-merge//") | grep -o '[^ ]*$')
# echo "bucket=$BUCKET" >> $GITHUB_OUTPUT
- name: get cdk bucket # - name: cp package images from prod to preview bucket
id: DEPLOY_BUCKET # run: |
run: | # aws s3 cp s3://www.tea.xyz/Images/packages \
BUCKET=$(aws s3 ls | grep $(echo teaxyz-pr-$GITHUB_REF_SLUG_URL | sed "s/-merge//") | grep -o '[^ ]*$') # s3://$NEW_BUCKET/Images/packages \
echo "bucket=$BUCKET" >> $GITHUB_OUTPUT # --recursive
# env:
# NEW_BUCKET: ${{ steps.DEPLOY_BUCKET.outputs.bucket }}
- name: cp package images from prod to preview bucket # - name: Seal Deployment
run: | # uses: bobheadxi/deployments@v1
aws s3 cp s3://www.tea.xyz/Images/packages \ # if: always()
s3://$NEW_BUCKET/Images/packages \ # with:
--recursive # step: finish
env: # status: ${{ job.status }}
NEW_BUCKET: ${{ steps.DEPLOY_BUCKET.outputs.bucket }} # deployment_id: ${{ steps.deployment.outputs.deployment_id }}
# env: ${{ env.STAGE }}
- name: Seal Deployment # env_url: ${{ steps.cdk_deploy.outputs.env_url }}
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 }}