2023-05-17 10:27:22 +00:00
|
|
|
name: Clone or pull repository
|
|
|
|
on:
|
2023-05-17 10:34:32 +00:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- prod
|
2023-05-17 10:27:22 +00:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: Run remote SSH command
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-05-17 10:38:52 +00:00
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Install dependencies
|
|
|
|
run: npm install dotenv
|
|
|
|
- name: Load environment variables from .env file
|
|
|
|
run: |
|
|
|
|
source .env.prod
|
|
|
|
- name: Print environment variable
|
2023-05-17 10:42:25 +00:00
|
|
|
run: echo ${PAYLOAD_URL}
|
2023-05-17 10:38:52 +00:00
|
|
|
|
2023-05-17 10:27:22 +00:00
|
|
|
- name: Trigger build via ssh
|
|
|
|
uses: appleboy/ssh-action@master
|
|
|
|
with:
|
|
|
|
host: ${{ secrets.HOST }}
|
|
|
|
username: ${{ secrets.USER }}
|
|
|
|
key: ${{ secrets.KEY }}
|
|
|
|
script: |
|
2023-05-17 10:44:01 +00:00
|
|
|
echo ${{ PAYLOAD_URL }}
|
|
|
|
echo ${PAYLOAD_URL}
|
|
|
|
echo $PAYLOAD_URL
|