Merge pull request #528 from RyoJerryYu/dependabot/npm_and_yarn/shiki… #141
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
name: Deploy to AWS test | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- 'test/**' | |
workflow_dispatch: | |
jobs: | |
build: | |
if: github.actor != 'dependabot[bot]' | |
uses: ./.github/workflows/build.yaml | |
with: | |
site-origin: https://test.ryo-okami.xyz | |
site-base-path: '' | |
deploy: | |
needs: build | |
runs-on: ubuntu-latest | |
environment: | |
name: Preview | |
url: https://test.ryo-okami.xyz | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
# Deploy to gh-pages should be in a git directory | |
- name: Download Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: blog-next | |
path: out | |
- name: Debug | |
run: | | |
ls -al out | |
cat out/sitemap.xml | |
- name: Configure AWS | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ap-northeast-1 | |
- name: Deploy | |
env: | |
S3_BUCKET: test.ryo-okami.xyz | |
DISTRIBUTION_ID: E3DFPA0YC9J6TJ | |
run: | | |
aws s3 ls --region=ap-northeast-1 | |
aws s3 ls s3://$S3_BUCKET --region=ap-northeast-1 | |
aws s3 rm s3://$S3_BUCKET/ --recursive --region=ap-northeast-1 | |
echo "After remove" | |
aws s3 ls s3://$S3_BUCKET --region=ap-northeast-1 | |
aws s3 cp ./out s3://$S3_BUCKET/ --recursive --region=ap-northeast-1 | |
aws cloudfront create-invalidation --distribution-id $DISTRIBUTION_ID --paths '/*' --region=us-east-1 |