Fix build workflow #2
This file contains hidden or 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 | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - "*" | |
| permissions: | |
| pages: write | |
| id-token: write | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| env: | |
| HUGO_VERSION: 0.145.0 | |
| strategy: | |
| fail-fast: true | |
| outputs: | |
| vsixPath: ${{ steps.packageExtension.outputs.vsixPath }} | |
| steps: | |
| - name: Checkout Source | |
| uses: actions/checkout@v4 | |
| - name: Install Hugo CLI | |
| run: | | |
| wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \ | |
| && sudo dpkg -i ${{ runner.temp }}/hugo.deb | |
| - name: Install Node 20 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Install Dependencies | |
| run: npm ci | |
| - name: Build website | |
| run: npm run build | |
| - name: Upload static files as artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: static-files | |
| path: public/ | |
| publish: | |
| name: Publish | |
| needs: | |
| - build | |
| if: github.ref_name == 'main' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Source | |
| uses: actions/checkout@v4 | |
| - name: Deploy to Github Pages | |
| uses: actions/deploy-pages@v4 | |
| with: | |
| artifact_name: static-files | |