lib.itmens/.github/workflows/preview-deploy.yml

42 lines
1.2 KiB
YAML
Raw Normal View History

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
concurrency:
2023-11-30 18:58:08 -05:00
group: ${{ github.workflow }}
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:
- 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 }}
port: ${{ secrets.SSH_PORT }}
2023-02-08 18:07:13 -05:00
username: ${{ secrets.SSH_USER }}
key: ${{ secrets.SSH_KEY }}
script: ${{ vars.DEPLOY_SCRIPT }}
- name: Send complete 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 }} complete