Skip to content

Instantly share code, notes, and snippets.

@zachisit
Created March 4, 2021 21:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zachisit/819279198b69c9b912ba36e65642bfd8 to your computer and use it in GitHub Desktop.
Save zachisit/819279198b69c9b912ba36e65642bfd8 to your computer and use it in GitHub Desktop.
name: Deploy to Vapor
on:
push:
branches:
- vapor-deploy
jobs:
vapor-deploy:
runs-on: ubuntu-latest
steps:
- name: Send started notification to Slack
uses: voxmedia/github-action-slack-notify-build@v1
id: slack
with:
channel: client-name-notification
status: STARTED
color: warning
env: SLACK_BOT_TOKEN: ${{ secrets.SLACK_ACTIONS_NOTIFIER_BOT_TOKEN }}
- name: Install dependencies
uses: actions/checkout@v1
run: composer install --prefer-dist --no-progress --no-suggest
- name: Deploy to Vapor
env: VAPOR_API_TOKEN: ${{ secrets.VAPOR_API_TOKEN }}
run: vendor/bin/vapor deploy staging --commit="${{ github.sha }}"
- name: Send failed notification to Slack
uses: voxmedia/github-action-slack-notify-build@v1
if: failure()
with:
message_id: ${{ steps.slack.outputs.message_id }}
channel: client-name-notification
status: FAILED
color: danger
env: SLACK_BOT_TOKEN: ${{ secrets.SLACK_ACTIONS_NOTIFIER_BOT_TOKEN }}
- name: Send success notification to Slack
uses: voxmedia/github-action-slack-notify-build@v1
if: success()
with:
message_id: ${{ steps.slack.outputs.message_id }}
channel: client-name-notification
status: SUCCESS
color: good
env: SLACK_BOT_TOKEN: ${{ secrets.SLACK_ACTIONS_NOTIFIER_BOT_TOKEN }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment