run on feature branch #857
Workflow file for this run
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: GitHub Pages | |
| on: | |
| push: | |
| branches: # TODO: Decide which branches to build | |
| - main | |
| - develop | |
| - feature/deploy-pages | |
| workflow_dispatch: | |
| jobs: | |
| # BUILD | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v5 | |
| - name: Setup Hugo | |
| uses: peaceiris/actions-hugo@v3 | |
| with: | |
| hugo-version: '0.133.0' | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: 'npm' | |
| cache-dependency-path: package-lock.json | |
| - name: Install Tools | |
| run: npm install -g postcss-cli autoprefixer | |
| - name: NPM install | |
| run: | | |
| npm config set "@skymatic:registry" https://npm.pkg.github.com/ | |
| npm config set '//npm.pkg.github.com/:_authToken' "${{ secrets.FONTAWESOME_AUTH_TOKEN }}" | |
| npm install | |
| - name: Build | |
| run: hugo | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: 'public' | |
| # DEPLOY | |
| deploy: | |
| if: github.ref == 'refs/heads/main' | |
| name: Deploy to GitHub Pages | |
| runs-on: ubuntu-latest | |
| needs: [build] | |
| permissions: # Grant GITHUB_TOKEN the permissions required to make a Pages deployment | |
| pages: write # to deploy to Pages | |
| id-token: write # to verify the deployment originates from an appropriate source | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 # or specific "vX.X.X" version tag for this action | |
| environment: # Deploy to the github-pages environment | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} |