rolling.yml 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. steps:
  17. - uses: actions/checkout@v2
  18. with:
  19. ref: 'master'
  20. - name: Retrieve Certs
  21. run: |
  22. ./script/retrieve_certs
  23. env:
  24. GIT_USER: ${{ secrets.GIT_USER }}
  25. GIT_AUTH: ${{ secrets.GIT_AUTH }}
  26. GIT_URL: ${{ secrets.GIT_URL }}
  27. CERTS_KEY: ${{ secrets.CERTS_KEY }}
  28. - name: Set Release Tag
  29. run: echo "release_tag=$(cat version.txt)" >> $GITHUB_ENV
  30. - name: Download endpoints.yml and main.yml from Development
  31. run: |
  32. wget https://raw.githubusercontent.com/netbootxyz/netboot.xyz/development/endpoints.yml -O endpoints.yml
  33. wget https://raw.githubusercontent.com/netbootxyz/netboot.xyz/development/roles/netbootxyz/defaults/main.yml -O roles/netbootxyz/defaults/main.yml
  34. chmod +x script/build_release
  35. - name: Build release
  36. run: |
  37. ./script/build_release rolling
  38. - name: Configure AWS credentials
  39. uses: aws-actions/configure-aws-credentials@v1
  40. with:
  41. aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
  42. aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
  43. aws-region: ${{ secrets.AWS_ACCESS_REGION }}
  44. - name: Deploy master to rolling bucket
  45. run: |
  46. aws s3 sync --no-progress --acl public-read s3out-latest s3://${{ secrets.AWS_S3_BUCKET_PROD }}
  47. - name: Invalidate Cloudfront
  48. run: |
  49. aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DIST_ID_PROD }} --paths "/*" "/ipxe/*"
  50. - name: Notify Discord on failure
  51. if: failure()
  52. run: |
  53. ./script/message failure
  54. - name: Notify Discord on completion
  55. if: success()
  56. run: |
  57. ./script/message rolling-push