Skip to content

Merge pull request #158 from dracor-org/dependabot/npm_and_yarn/adobe… #467

Merge pull request #158 from dracor-org/dependabot/npm_and_yarn/adobe…

Merge pull request #158 from dracor-org/dependabot/npm_and_yarn/adobe… #467

Workflow file for this run

# This workflow will do a clean install of node dependencies, run tests, build
# the source code and deploy the resulting files to the staging or production
# server (depending on the branch).
name: CD
on:
push:
branches: [ main, production ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v3
with:
node-version: '18.x'
- name: Restore node_modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.os }}-${{ hashFiles('yarn.lock') }}
- run: yarn install
- run: yarn test --watchAll=false
- run: yarn build
- uses: webfactory/ssh-agent@v0.5.1
with:
ssh-private-key: ${{ secrets.DRACOR_ORG_DEPLOY_KEY }}
- name: Deploy to staging
run: rsync -rlvz --delete -e 'ssh -o StrictHostKeyChecking=no' build/ ${{ secrets.DRACOR_ORG_DEPLOY_USER }}@staging.dracor.org:${{ secrets.DEPLOY_PATH }}/
if: github.ref == 'refs/heads/main'
- name: Deploy to production
run: rsync -rlvz --delete -e 'ssh -o StrictHostKeyChecking=no' build/ ${{ secrets.DRACOR_ORG_DEPLOY_USER }}@dracor.org:${{ secrets.DEPLOY_PATH }}/
if: github.ref == 'refs/heads/production'