Merge pull request #4 from tofran/dependabot/npm_and_yarn/static-site… #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: Deploy static site | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
concurrency: | |
group: "github-pages" | |
cancel-in-progress: false | |
jobs: | |
build-and-deploy: | |
name: Build and deploy | |
runs-on: ubuntu-latest | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
defaults: | |
run: | |
working-directory: ./static-site | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version-file: ./static-site/.nvmrc | |
- name: Install lib dependencies | |
working-directory: ./lib | |
run: npm ci --no-fund --prefer-offline --no-audit | |
- name: Install static-site dependencies | |
run: npm ci --no-fund --prefer-offline --no-audit | |
- run: npm run build | |
- name: Upload site | |
uses: actions/upload-pages-artifact@v1 | |
if: ${{ github.ref == 'refs/heads/main' }} | |
with: | |
path: ./static-site/build | |
- name: Deploy site | |
uses: actions/deploy-pages@v2 | |
id: deployment | |
if: ${{ github.ref == 'refs/heads/main' }} |