1
0

deploy.yml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. name: deploy
  2. on:
  3. push:
  4. branches:
  5. - master
  6. repository_dispatch:
  7. types: [build]
  8. workflow_dispatch:
  9. jobs:
  10. release:
  11. name: Build and deploy site
  12. runs-on: ubuntu-latest
  13. permissions:
  14. id-token: write
  15. contents: read
  16. if: "!contains(github.event.head_commit.message, '[skip ci]')"
  17. steps:
  18. - name: Checkout
  19. uses: actions/checkout@v4
  20. - name: Download external project files
  21. run: |
  22. wget https://raw.githubusercontent.com/netbootxyz/netboot.xyz/development/CHANGELOG.md -O external/changelog.md
  23. wget https://raw.githubusercontent.com/netbootxyz/build-pipelines/master/README.md -O external/build-automation.md
  24. wget https://raw.githubusercontent.com/netbootxyz/netboot.xyz/master/CONTRIBUTING.md -O external/contributing.md
  25. curl https://raw.githubusercontent.com/netbootxyz/docker-netbootxyz/master/README.md | tail -n+6 > external/docker.md
  26. - name: Setup Node.js
  27. uses: actions/setup-node@v4
  28. with:
  29. node-version: 18
  30. - name: Install dependencies
  31. run: yarn install
  32. - name: Build static site
  33. run: yarn run build
  34. - name: Configure AWS credentials
  35. uses: aws-actions/configure-aws-credentials@v4
  36. with:
  37. role-to-assume: ${{ secrets.AWS_ROLE_DOCS }}
  38. aws-region: ${{ secrets.AWS_ACCESS_REGION }}
  39. - name: Deploy site to bucket
  40. run: |
  41. aws s3 sync --no-progress --acl public-read build s3://${{ secrets.BUCKET_SITE }}
  42. - name: Invalidate Cloudfront
  43. run: |
  44. aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DIST_ID_SITE }} --paths "/*"