From 62dd0ace9f53f7e2b337d1de76f4db97e4da98a9 Mon Sep 17 00:00:00 2001 From: david-yz-liu Date: Tue, 16 Apr 2024 16:30:10 -0400 Subject: [PATCH] Set up CI to publish website --- .github/workflows/ci.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fd0bf878..a9f7d833 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,3 +45,35 @@ jobs: uses: coverallsapp/github-action@v2 with: github-token: ${{ secrets.GITHUB_TOKEN }} + + build: + runs-on: ubuntu-latest + environment: + name: publish-docs + url: https://www.cs.toronto.edu/~david/memory-viz + if: github.ref == 'refs/heads/master' + steps: + - uses: actions/checkout@v3 + - name: Set up node and cache packages + uses: actions/setup-node@v3 + with: + node-version: 18 + cache: npm + - name: Install npm packages + run: npm ci + - name: Build docs and demo website + run: | + npm run build --workspace=demo + npm run build --workspace=docs + mkdir docs/build/demo + cp -r demo/dist/* docs/build/demo + - name: Deploy to Server + uses: easingthemes/ssh-deploy@main + with: + SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} + ARGS: "-rlgoDzvc -i --delete" + SOURCE: "docs/build/" + REMOTE_HOST: ${{ secrets.REMOTE_HOST }} + REMOTE_USER: ${{ secrets.REMOTE_USER }} + TARGET: ${{ secrets.REMOTE_TARGET }} + EXCLUDE: "/dist/, /node_modules/"