rolling.yml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. name: rolling
  2. on:
  3. push:
  4. paths:
  5. - 'endpoints.yml'
  6. - 'roles/netbootxyz/defaults/main.yml'
  7. branches:
  8. - development
  9. env:
  10. DISCORD_HOOK_URL: ${{ secrets.DISCORD_HOOK_URL }}
  11. GITHUB_SHA: ${{ github.sha }}
  12. jobs:
  13. rolling:
  14. name: Build Release
  15. runs-on: ubuntu-latest
  16. permissions:
  17. id-token: write
  18. contents: write
  19. steps:
  20. - uses: actions/checkout@v4
  21. with:
  22. ref: 'master'
  23. - name: Retrieve Certs
  24. run: |
  25. ./script/retrieve_certs
  26. env:
  27. GIT_USER: ${{ secrets.GIT_USER }}
  28. GIT_AUTH: ${{ secrets.GIT_AUTH }}
  29. GIT_URL: ${{ secrets.GIT_URL }}
  30. CERTS_KEY: ${{ secrets.CERTS_KEY }}
  31. - name: Set Release Tag
  32. run: echo "release_tag=$(cat version.txt)" >> $GITHUB_ENV
  33. - name: Download endpoints.yml and main.yml from Development
  34. run: |
  35. wget https://raw.githubusercontent.com/netbootxyz/netboot.xyz/development/endpoints.yml -O endpoints.yml
  36. wget https://raw.githubusercontent.com/netbootxyz/netboot.xyz/development/roles/netbootxyz/defaults/main.yml -O roles/netbootxyz/defaults/main.yml
  37. chmod +x script/build_release
  38. - name: Build release
  39. run: |
  40. ./script/build_release rolling
  41. - name: Configure AWS credentials
  42. uses: aws-actions/configure-aws-credentials@v4
  43. with:
  44. role-to-assume: ${{ secrets.AWS_ROLE_ROLLING }}
  45. aws-region: ${{ secrets.AWS_ACCESS_REGION }}
  46. - name: Deploy master to rolling bucket
  47. run: |
  48. aws s3 sync --no-progress --acl public-read s3out-latest s3://${{ secrets.AWS_S3_BUCKET_PROD }}
  49. - name: Invalidate Cloudfront
  50. run: |
  51. aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DIST_ID_PROD }} --paths "/*" "/ipxe/*" "/sigs/*"
  52. - name: Notify Discord on failure
  53. if: failure()
  54. run: |
  55. ./script/message failure
  56. - name: Notify Discord on completion
  57. if: success()
  58. run: |
  59. ./script/message rolling-push