rolling.yml 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. - name: Build release
  35. run: |
  36. ./script/build_release rolling
  37. - name: Configure AWS credentials
  38. uses: aws-actions/configure-aws-credentials@v1
  39. with:
  40. aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
  41. aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
  42. aws-region: ${{ secrets.AWS_ACCESS_REGION }}
  43. - name: Deploy master to rolling bucket
  44. run: |
  45. aws s3 sync --no-progress --acl public-read s3out-latest s3://${{ secrets.AWS_S3_BUCKET_PROD }}
  46. - name: Invalidate Cloudfront
  47. run: |
  48. aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DIST_ID_PROD }} --paths "/*" "/ipxe/*"
  49. - name: Notify Discord on failure
  50. if: failure()
  51. run: |
  52. ./script/message failure
  53. - name: Notify Discord on completion
  54. if: success()
  55. run: |
  56. ./script/message rolling-push