Skip to content

Commit

Permalink
chore: add docs workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanvanherwijnen committed Oct 1, 2024
1 parent 221970e commit 31730d2
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/deploy-docs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build and deploy through rsync

on:
push:
branches: ["production"]

env:
working-directory: ./packages/docs/
url: www.slimfact.app

jobs:
build:
name: Build and deploy production
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Creating .npmrc
run: |
cat > ~/.npmrc << EOF
//npm.simsus.tech/:_authToken=$SIMSUSTECH_NPM_TOKEN
EOF
env:
SIMSUSTECH_NPM_TOKEN: ${{ secrets.SIMSUSTECH_NPM_TOKEN }}

- name: Install pnpm
uses: pnpm/action-setup@v3
with:
version: 9

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Install dependencies
run: pnpm i

- name: Build
working-directory: ${{ env.working-directory }}
run: |
pnpm run build
- name: rsync deployments
uses: burnett01/[email protected]
with:
switches: -avzr --delete
path: ${{env.working-directory}}dist/static/
remote_path: /srv/${{env.url}}
remote_host: ${{ secrets.DEPLOY_HOST }}
remote_user: ${{ secrets.DEPLOY_USER }}
remote_key: ${{ secrets.DEPLOY_KEY }}

- name: Remove .npmrc
run: rm ~/.npmrc

0 comments on commit 31730d2

Please sign in to comment.