mirror of
https://github.com/logto-io/logto.git
synced 2025-01-06 20:40:08 -05:00
48 lines
1.2 KiB
YAML
48 lines
1.2 KiB
YAML
name: Deploy Dev
|
|
|
|
on:
|
|
push:
|
|
branches: [ master ]
|
|
|
|
jobs:
|
|
deploy:
|
|
environment: dev
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Cancel previous runs
|
|
uses: styfle/cancel-workflow-action@0.9.1
|
|
with:
|
|
access_token: ${{ github.token }}
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: Setup Node and pnpm
|
|
uses: logto-io/actions-node-pnpm-run-steps@v1.0.2
|
|
|
|
- name: Build
|
|
run: pnpm -- lerna run build --stream
|
|
|
|
# See warning in https://pnpm.io/cli/prune
|
|
- name: Prune
|
|
run: rm -rf node_modules packages/*/node_modules && pnpm i
|
|
env:
|
|
NODE_ENV: production
|
|
|
|
- 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
|
|
run: rsync --filter='exclude .git' -r -a ./ $DEV_SERVER_IP:~/logto
|
|
env:
|
|
DEV_SERVER_IP: ${{ secrets.DEV_SERVER_IP }}
|