name: Publish Website on: push: branches: - main # enable users to manually trigger with workflow_dispatch workflow_dispatch: {} jobs: publish-website: name: Publish Website runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: node-version: 14 - name: Cache node modules id: cacheNodeModules uses: actions/cache@v2 with: path: '**/node_modules' key: ${{ runner.os }}-cacheNodeModules-${{ hashFiles('**/package-lock.json') }} restore-keys: ${{ runner.os }}-cacheNodeModules- - name: Install node modules (1) if: ${{ steps.cacheNodeModules.outputs.cache-hit != 'true' }} run: npm ci - name: Build website run: npm run build-website - name: Deploy to GitHub Pages env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: ./.github/workflows/publish-website.sh