Deployment #36
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deployment | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ master ] | |
jobs: | |
deploy-API-documentation: | |
if: github.event_name == 'workflow_dispatch' || (github.event_name == 'status' && github.event.state == 'success') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 2.6.6 # Not needed with a .ruby-version file | |
bundler-cache: true | |
- name: Deployment script | |
run: ./deploy.sh | |
notify-failure: | |
runs-on: ubuntu-latest | |
needs: [deploy-API-documentation] | |
if: ${{ failure() }} | |
steps: | |
- name: Slack notification | |
uses: 8398a7/action-slack@v3 | |
with: | |
status: custom | |
username: CucumberStudio API Documentation | |
custom_payload: | | |
{ | |
text: ":fire: CucumberStudio API Documentation deployment failed", | |
attachments: [{ | |
"color": "warning", | |
"title": 'GitHub commit: ${{github.sha}}', | |
"title_link": 'https://github.com/${{github.repository}}/commit/${{github.sha}}', | |
"text": '${{github.event.commits[0].message}}', | |
} | |
] | |
} | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }} |