12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- name: deploy
- on:
- push:
- branches:
- - master
- repository_dispatch:
- types: [build]
- workflow_dispatch:
- jobs:
- release:
- name: Build and deploy site
- runs-on: ubuntu-latest
- if: "!contains(github.event.head_commit.message, '[skip ci]')"
- steps:
- - name: Checkout
- uses: actions/checkout@v2
- - name: Download external project files
- run: |
- wget https://raw.githubusercontent.com/netbootxyz/netboot.xyz/master/CHANGELOG.md -O external/CHANGELOG.md
- - name: Setup Node.js
- uses: actions/setup-node@v2
- with:
- node-version: 14
- - name: Install dependencies
- run: yarn install
- - name: Build static site
- run: yarn run build
- - 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: ${{ secrets.AWS_ACCESS_REGION }}
- - name: Deploy site to bucket
- run: |
- aws s3 sync --no-progress --acl public-read build s3://${{ secrets.BUCKET_SITE }}
- - name: Invalidate Cloudfront
- run: |
- aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DIST_ID_SITE }} --paths "/*"
|