2021-07-30 09:34:15 -05:00
|
|
|
name: Deploy Dev
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2022-06-23 06:17:02 -05:00
|
|
|
branches: [master]
|
2021-07-30 09:34:15 -05:00
|
|
|
|
2022-06-17 10:58:29 -05:00
|
|
|
concurrency: deploy-dev
|
|
|
|
|
2021-07-30 09:34:15 -05:00
|
|
|
jobs:
|
|
|
|
deploy:
|
2021-08-10 04:17:47 -05:00
|
|
|
environment: dev
|
2021-07-30 09:34:15 -05:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2022-04-22 04:13:21 -05:00
|
|
|
- uses: actions/checkout@v3
|
2021-07-30 09:34:15 -05:00
|
|
|
|
2021-08-20 05:16:00 -05:00
|
|
|
- name: Setup Node and pnpm
|
2022-07-19 17:42:42 -05:00
|
|
|
uses: silverhand-io/actions-node-pnpm-run-steps@v1.2.3
|
2021-07-30 09:34:15 -05:00
|
|
|
|
|
|
|
- name: Build
|
|
|
|
run: pnpm -- lerna run build --stream
|
2021-07-30 09:54:48 -05:00
|
|
|
|
|
|
|
# See warning in https://pnpm.io/cli/prune
|
|
|
|
- name: Prune
|
|
|
|
run: rm -rf node_modules packages/*/node_modules && pnpm i
|
|
|
|
env:
|
|
|
|
NODE_ENV: production
|
2021-07-30 11:24:32 -05:00
|
|
|
|
|
|
|
- name: Setup env
|
|
|
|
working-directory: packages/core
|
|
|
|
run: echo "$DEV_CORE_ENV" >> .env
|
|
|
|
env:
|
|
|
|
DEV_CORE_ENV: ${{ secrets.DEV_CORE_ENV }}
|
|
|
|
|
|
|
|
- name: Install SSH key
|
|
|
|
uses: shimataro/ssh-key-action@v2
|
|
|
|
with:
|
|
|
|
key: ${{ secrets.DEV_SSH_KEY }}
|
|
|
|
known_hosts: ${{ secrets.DEV_SSH_KNOWN_HOSTS }}
|
|
|
|
config: ${{ secrets.DEV_SSH_CONFIG }}
|
|
|
|
|
|
|
|
- name: Rsync folder
|
2022-04-29 08:22:15 -05:00
|
|
|
run: rsync --filter='exclude .git' -r -a --delete-before --ignore-times ./ $DEV_SERVER_IP:~/logto
|
2021-07-30 11:24:32 -05:00
|
|
|
env:
|
|
|
|
DEV_SERVER_IP: ${{ secrets.DEV_SERVER_IP }}
|
2021-09-05 21:40:06 -05:00
|
|
|
|
|
|
|
- name: Sleep for 5 seconds
|
|
|
|
run: sleep 5s
|
|
|
|
|
|
|
|
- name: Health check
|
|
|
|
run: curl $DEV_SERVER_URL/api/status -If
|
|
|
|
env:
|
|
|
|
DEV_SERVER_URL: ${{ secrets.DEV_SERVER_URL }}
|