Merge pull request #383 from codenotary/app_samples #26
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 and Deploy | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: create .env | |
run: | | |
cat <<EOF > .env | |
ALGOLIA_API_KEY=${{secrets.ALGOLIA_API_KEY}} | |
ALGOLIA_APP_ID=${{secrets.ALGOLIA_APP_ID}} | |
ALGOLIA_INDEX=immudb | |
ALGOLIA_WRIGHT_API_KEY=${{secrets.ALGOLIA_WRIGHT_API_KEY}} | |
EOF | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: "14.18.3" | |
cache: "npm" | |
- name: Node version | |
run: node --version | |
# cache node_modules | |
- name: Cache dependencies | |
uses: actions/cache@v2 | |
id: node-modules-cache | |
with: | |
path: | | |
**/node_modules | |
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node_modules- | |
- name: Node dependencies | |
if: steps.node-modules-cache.outputs.cache-hit != 'true' | |
run: npm i -f | |
- name: Build | |
run: npm run build | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./docs | |
- name: Index algolia | |
run: npm run algolia:index |