| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- "on":
- push:
- tags:
- - production
- name: Deploy Porter to Production
- jobs:
- deploy-start:
- name: Mark deploy as started
- runs-on: ubuntu-latest
- outputs:
- deploy-ts: ${{ steps.deploy.outputs.ts }}
- steps:
- - name: Slack Notification
- uses: slackapi/slack-github-action@v1
- id: deploy
- continue-on-error: true
- env:
- SLACK_WEBHOOK_URL: ${{ secrets.PORTER_PROD_NOTIFICATIONS_SLACK_WEBHOOK }}
- with:
- payload: |
- {
- "text": "porter prod deploy started (In Progress)\n<${{ github.event.pull_request.html_url || github.event.head_commit.url }}|Link to commit>",
- "attachments": [
- {
- "pretext": "Deployment started",
- "color": "dbab09",
- "fields": [
- {
- "title": "Status",
- "short": true,
- "value": "In Progress"
- }
- ]
- }
- ]
- }
- build-go:
- runs-on: ubuntu-latest
- needs:
- - deploy-start
- steps:
- - name: Checkout code
- uses: actions/checkout@v3
- - name: build-go
- uses: ./.github/actions/build-go
- build-npm:
- runs-on: ubuntu-latest
- needs:
- - deploy-start
- steps:
- - name: Checkout code
- uses: actions/checkout@v3
- - name: build-npm
- uses: ./.github/actions/build-npm
- deploy-porter:
- runs-on: ubuntu-latest
- needs: [ build-go, build-npm ]
- steps:
- - name: Checkout code
- uses: actions/checkout@v3
- - name: porter-deploy
- timeout-minutes: 30
- uses: ./.github/actions/porter-deploy
- with:
- app: porter
- cluster: "9"
- host: https://dashboard.internal-tools.porter.run
- project: "5"
- token: ${{ secrets.PORTER_STACK_5_9 }}
- deploy-worker-pool:
- runs-on: ubuntu-latest
- needs: [build-go, build-npm] # don't run this step unless these finish successfully
- steps:
- - name: Checkout code
- uses: actions/checkout@v3
- - name: Set Github tag
- id: vars
- run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- - name: Update Worker Pool (revision cull job)
- timeout-minutes: 20
- uses: porter-dev/porter-update-action@v0.1.0
- with:
- app: cull-helm-revisions
- cluster: "9"
- host: https://dashboard.internal-tools.porter.run
- namespace: default
- project: "5"
- tag: ${{ steps.vars.outputs.sha_short }}
- token: ${{ secrets.PORTER_PRODUCTION_DEPLOYMENT }}
- deploy-end:
- name: Mark deploy as ended
- runs-on: ubuntu-latest
- if: always()
- needs:
- - deploy-start
- - deploy-porter
- - deploy-worker-pool
- steps:
- - name: Slack Notification
- uses: slackapi/slack-github-action@v1
- continue-on-error: true
- env:
- SLACK_WEBHOOK_URL: ${{ secrets.PORTER_PROD_NOTIFICATIONS_SLACK_WEBHOOK }}
- with:
- update-ts: ${{ steps.deploy-start.outputs.deploy-ts }}
- payload: |
- {
- "text": "porter prod deploy completed\n<${{ github.event.pull_request.html_url || github.event.head_commit.url }}|Link to commit>",
- "attachments": [
- {
- "pretext": "Deployment completed",
- "color": "8590ff",
- "fields": [
- {
- "title": "Porter Result",
- "short": true,
- "value": "${{ needs.deploy-porter.result }}"
- },
- {
- "title": "Worker Pool Result",
- "short": true,
- "value": "${{ needs.deploy-worker-pool.result }}"
- }
- ]
- }
- ]
- }
|