Add CD workflow (#18648)
This commit is contained in:
parent
4d413af4cc
commit
be7a779f36
1 changed files with 29 additions and 5 deletions
|
|
@ -1,4 +1,4 @@
|
|||
name: CI
|
||||
name: CI/CD
|
||||
|
||||
on:
|
||||
push:
|
||||
|
|
@ -190,11 +190,14 @@ jobs:
|
|||
CI-status-report:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [rspec, jest, cypress, build-test]
|
||||
if: always()
|
||||
|
||||
steps:
|
||||
- run: echo "All done"
|
||||
- run: echo ${{ github.event.pull_request.head.ref }}
|
||||
- run: echo ${{ github.ref }}
|
||||
- run: exit 0
|
||||
if: success()
|
||||
|
||||
- run: exit 1
|
||||
if: failure()
|
||||
|
||||
- name: Report failure to Slack channel
|
||||
uses: slackapi/slack-github-action@v1
|
||||
|
|
@ -203,4 +206,25 @@ jobs:
|
|||
{ "link": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" }
|
||||
env:
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
|
||||
if: always() && github.ref == 'refs/heads/main' && failure()
|
||||
if: failure() && github.ref == 'refs/heads/main'
|
||||
|
||||
Deploy:
|
||||
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
|
||||
runs-on: ubuntu-latest
|
||||
needs: [CI-status-report]
|
||||
environment: ${{ matrix.environment }}
|
||||
concurrency: ${{ matrix.environment }}
|
||||
timeout-minutes: 30
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
environment: [ Production ]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: akhileshns/heroku-deploy@v3.12.12
|
||||
with:
|
||||
heroku_api_key: ${{ secrets.HEROKU_API_KEY }}
|
||||
heroku_app_name: ${{ secrets.HEROKU_APP_NAME }}
|
||||
heroku_email: ${{ secrets.HEROKU_EMAIL }}
|
||||
Loading…
Add table
Reference in a new issue