File size: 1,042 Bytes
5aa963a 6ba478e 5aa963a 6ba478e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
name: deploy
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 7.33.1
- uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'pnpm'
- run: |
pnpm install --frozen-lockfile
echo $DOT_ENV > .env.local
pnpm build
env:
DOT_ENV: ${{ vars.DOT_ENV }}
- name: Install SSH Key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
known_hosts: ${{ secrets.SSH_KNOWN_HOSTS }}
- name: Deploy
run: |
zip -r build.zip build
scp build.zip ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:bergere-enchantee/build.zip
ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} "hostnamectl && cd bergere-enchantee && git fetch && git checkout $GITHUB_SHA && pnpm install && unzip -o build.zip && pm2 reload bergere"
|