(chore) fixes to build ci (#14) #46
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: OHRI DOCS CI | |
on: | |
push: | |
tags: | |
- "*" | |
branches: | |
- "*" | |
pull_request: | |
branches: | |
- "*" | |
types: [opened, synchronize] | |
release: | |
types: | |
- created | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: pnpm/action-setup@v2 | |
with: | |
version: 8 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "18" | |
- name: Cache dependencies | |
id: cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.pnpm | |
${{ github.workspace }}/.next/cache | |
# Generate a new cache whenever packages or source files change. | |
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }} | |
# If source files changed but packages didn't, rebuild from a prior cache. | |
restore-keys: | | |
${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}- | |
- name: Install dependencies | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: pnpm install | |
- name: Run build | |
run: pnpm build | |
docs_deployment: | |
runs-on: ubuntu-latest | |
needs: build | |
if: ${{ github.ref == 'refs/heads/dev' }} | |
steps: | |
# Update the Microfrontends to reflect what we have in the Working branch | |
- uses: garygrossgarten/github-action-ssh@release | |
name: BackUp and Run the Update DOCS Site Script | |
with: | |
command: cd /usr/share/tomcat/microfrontends/ | |
sh deploy-ohri-docs.sh | |
host: ${{ secrets.HISTAC_HOST }} | |
username: ${{ secrets.HISTAC_USERNAME }} | |
privateKey: ${{ secrets.HISTAC_KEY}} | |
port: ${{ secrets.HISTAC_PORT }} |