production.yml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. "on":
  2. push:
  3. tags:
  4. - production
  5. name: Deploy Porter to Production
  6. jobs:
  7. deploy-start:
  8. name: Mark deploy as started
  9. runs-on: ubuntu-latest
  10. outputs:
  11. deploy-ts: ${{ steps.deploy.outputs.ts }}
  12. steps:
  13. - name: Slack Notification
  14. uses: slackapi/slack-github-action@v1
  15. id: deploy
  16. continue-on-error: true
  17. env:
  18. SLACK_WEBHOOK_URL: ${{ secrets.PORTER_PROD_NOTIFICATIONS_SLACK_WEBHOOK }}
  19. with:
  20. payload: |
  21. {
  22. "text": "porter prod deploy started (In Progress)\n<${{ github.event.pull_request.html_url || github.event.head_commit.url }}|Link to commit>",
  23. "attachments": [
  24. {
  25. "pretext": "Deployment started",
  26. "color": "dbab09",
  27. "fields": [
  28. {
  29. "title": "Status",
  30. "short": true,
  31. "value": "In Progress"
  32. }
  33. ]
  34. }
  35. ]
  36. }
  37. build-go:
  38. runs-on: ubuntu-latest
  39. needs:
  40. - deploy-start
  41. steps:
  42. - name: Checkout code
  43. uses: actions/checkout@v3
  44. - name: build-go
  45. uses: ./.github/actions/build-go
  46. build-npm:
  47. runs-on: ubuntu-latest
  48. needs:
  49. - deploy-start
  50. steps:
  51. - name: Checkout code
  52. uses: actions/checkout@v3
  53. - name: build-npm
  54. uses: ./.github/actions/build-npm
  55. with:
  56. env_vars: ${{ vars.DASHBOARD_ENV_PRODUCTION }}
  57. deploy-porter:
  58. runs-on: ubuntu-latest
  59. needs: [ build-go, build-npm ]
  60. steps:
  61. - name: Checkout code
  62. uses: actions/checkout@v3
  63. - name: porter-deploy
  64. timeout-minutes: 30
  65. uses: ./.github/actions/porter-deploy
  66. with:
  67. app: porter
  68. cluster: "9"
  69. host: https://dashboard.internal-tools.porter.run
  70. project: "5"
  71. token: ${{ secrets.PORTER_STACK_5_9 }}
  72. deploy-end:
  73. name: Mark deploy as ended
  74. runs-on: ubuntu-latest
  75. if: always()
  76. needs:
  77. - deploy-start
  78. - deploy-porter
  79. - deploy-worker-pool
  80. steps:
  81. - name: Slack Notification
  82. uses: slackapi/slack-github-action@v1
  83. continue-on-error: true
  84. env:
  85. SLACK_WEBHOOK_URL: ${{ secrets.PORTER_PROD_NOTIFICATIONS_SLACK_WEBHOOK }}
  86. with:
  87. update-ts: ${{ steps.deploy-start.outputs.deploy-ts }}
  88. payload: |
  89. {
  90. "text": "porter prod deploy completed\n<${{ github.event.pull_request.html_url || github.event.head_commit.url }}|Link to commit>",
  91. "attachments": [
  92. {
  93. "pretext": "Deployment completed",
  94. "color": "8590ff",
  95. "fields": [
  96. {
  97. "title": "Porter Result",
  98. "short": true,
  99. "value": "${{ needs.deploy-porter.result }}"
  100. },
  101. {
  102. "title": "Worker Pool Result",
  103. "short": true,
  104. "value": "${{ needs.deploy-worker-pool.result }}"
  105. }
  106. ]
  107. }
  108. ]
  109. }