Build/Deploy to Staging (Vitepress) #4
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build/Deploy to Staging (Vitepress) | |
on: | |
workflow_dispatch: # this makes the action manual | |
jobs: | |
neon: | |
name: Build Neon | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Install dependencies | |
working-directory: ./neon | |
run: npm install | |
- name: Make build | |
working-directory: ./neon | |
run: npm run docs:build | |
- name: Upload | |
uses: actions/upload-artifact@v2 | |
with: | |
name: neon | |
path: neon/.vitepress/dist | |
invisible: | |
name: Build Invisible | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Install dependencies | |
working-directory: ./invisible | |
run: npm install | |
- name: Make build | |
working-directory: ./invisible | |
run: npm run docs:build | |
- name: Upload | |
uses: actions/upload-artifact@v2 | |
with: | |
name: invisible | |
path: invisible/.vitepress/dist | |
landing-page: | |
name: Upload landing page | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Index - Upload | |
uses: actions/upload-artifact@v2 | |
with: | |
name: landing-page | |
path: index.html | |
deploy-staging: | |
name: Deploy to staging | |
runs-on: ubuntu-latest | |
environment: | |
name: staging | |
url: https://docs-staging.pupil-labs.com | |
needs: [neon, invisible, landing-page] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Download Neon | |
uses: actions/download-artifact@v2 | |
with: | |
name: neon | |
path: neon/ | |
- name: Download Invisible | |
uses: actions/download-artifact@v2 | |
with: | |
name: invisible | |
path: invisible/ | |
- name: Download landing page | |
uses: actions/download-artifact@v2 | |
with: | |
name: landing-page | |
path: landing-page/ | |
- name: Rsync action - Deploy to staging | |
uses: burnett01/[email protected] | |
with: | |
switches: -hrvz --delete --exclude=".htaccess" | |
path: . | |
remote_path: ${{ secrets.REMOTE_PATH }} | |
remote_host: ${{ secrets.REMOTE_HOST}} | |
remote_user: ${{ secrets.REMOTE_USER }} | |
remote_key: ${{ secrets.DEPLOY_KEY }} |