2023-11-30 18:58:08 -05:00
|
|
|
name: Preview Deployment
|
|
|
|
|
2023-02-08 18:07:13 -05:00
|
|
|
on:
|
2023-02-08 22:49:06 -05:00
|
|
|
workflow_run:
|
2023-11-30 18:58:08 -05:00
|
|
|
workflows: ["Development Image"]
|
2023-02-08 22:49:06 -05:00
|
|
|
types:
|
|
|
|
- completed
|
2023-11-30 18:58:08 -05:00
|
|
|
|
2023-09-26 00:18:15 +00:00
|
|
|
concurrency:
|
2023-11-30 18:58:08 -05:00
|
|
|
group: ${{ github.workflow }}
|
2023-09-26 00:18:15 +00:00
|
|
|
cancel-in-progress: true
|
2023-11-30 18:58:08 -05:00
|
|
|
|
2023-02-08 18:07:13 -05:00
|
|
|
jobs:
|
|
|
|
deployment:
|
2023-02-08 22:49:06 -05:00
|
|
|
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
2023-10-22 23:52:30 -04:00
|
|
|
name: deployment to preview environment
|
2023-02-08 18:07:13 -05:00
|
|
|
runs-on: ubuntu-latest
|
2023-10-22 19:42:02 -04:00
|
|
|
environment: ${{ vars.DEPLOY_ENV }}
|
2023-02-08 18:07:13 -05:00
|
|
|
steps:
|
2023-11-21 09:20:58 -05:00
|
|
|
- name: Send start notification
|
|
|
|
uses: appleboy/discord-action@master
|
|
|
|
with:
|
|
|
|
webhook_id: ${{ secrets.DISCORD_WEBHOOK_ID }}
|
|
|
|
webhook_token: ${{ secrets.DISCORD_WEBHOOK_TOKEN }}
|
|
|
|
color: "#6848a9"
|
2023-11-30 18:58:08 -05:00
|
|
|
message: Deployment ${{ github.ref_name }} started
|
2023-02-08 18:07:13 -05:00
|
|
|
- name: ssh
|
|
|
|
uses: appleboy/ssh-action@master
|
|
|
|
with:
|
|
|
|
host: ${{ secrets.SSH_HOST }}
|
2023-09-26 00:18:15 +00:00
|
|
|
port: ${{ secrets.SSH_PORT }}
|
2023-02-08 18:07:13 -05:00
|
|
|
username: ${{ secrets.SSH_USER }}
|
|
|
|
key: ${{ secrets.SSH_KEY }}
|
|
|
|
script: ${{ vars.DEPLOY_SCRIPT }}
|
2023-11-21 09:20:58 -05:00
|
|
|
- name: Send complete notification
|
2023-11-01 23:17:43 -04:00
|
|
|
uses: appleboy/discord-action@master
|
|
|
|
with:
|
|
|
|
webhook_id: ${{ secrets.DISCORD_WEBHOOK_ID }}
|
|
|
|
webhook_token: ${{ secrets.DISCORD_WEBHOOK_TOKEN }}
|
2023-11-21 09:20:58 -05:00
|
|
|
color: "#6848a9"
|
2023-11-30 18:58:08 -05:00
|
|
|
message: Deployment ${{ github.ref_name }} complete
|