Files
infra-hideyoshi.com/.github/workflows/refresh-deployment.yml

43 lines
1.5 KiB
YAML

name: workflow_02
on:
repository_dispatch:
types: [refresh-deployments]
jobs:
refresh-deployments:
name: Refresh deployments
environment: prod
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Executing Remote Commands - Refresh All Deployments
env:
deployments: ${{ github.event.client_payload.deployments }}
if: ${{ env.deployments == '' }}
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
port: ${{ secrets.SSH_PORT }}
key: ${{ secrets.SSH_KEY }}
script: |
[[ -d infra-hideyoshi.com ]] && \
cd infra-hideyoshi.com && \
./refresh.sh
- name: Executing Remote Commands - Refresh Specific Deployments
env:
deployments: ${{ github.event.client_payload.deployments }}
if: ${{ env.deployments != '' }}
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
port: ${{ secrets.SSH_PORT }}
key: ${{ secrets.SSH_KEY }}
script: |
[[ -d infra-hideyoshi.com ]] && \
./infra-hideyoshi.com/refresh.sh ${{ env.deployments }}