Skip to content

initial commit

initial commit #1

Workflow file for this run

name: staging
on:
push:
branches:
- main
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20.x
cache: npm
- run: npm ci
- run: npm run build
env:
NODE_ENV: production
- uses: actions/upload-artifact@v3
with:
name: dist
path: ./dist
deploy-staging:
name: Deploy staging
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Install SSH key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.STAGING_SSH_KEY }}
known_hosts: ${{ secrets.STAGING_KNOWN_HOSTS }}
- uses: actions/download-artifact@v3
with:
name: dist
path: ./dist
- name: Deploy
run: rsync -e ssh --rsync-path='sudo rsync' -rltpzhv --delete ./dist ${{ secrets.STAGING_DEPLOY_USER }}@${{ secrets.STAGING_DEPLOY_HOST }}:${{ secrets.STAGING_DEPLOY_RSYNC_DESTINATION }}