Replace theme with Tailwind CSS + Alpine.js #79
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: Site preview | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| branches: | |
| - main | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| deploy: | |
| name: Build & Deploy | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| - name: Install theme dependencies | |
| run: npm install --prefix themes/capro-tw | |
| - name: Set env parameters | |
| run: | | |
| hugovr=$(cat .hugo_version) | |
| echo "hugovr=$hugovr" >> $GITHUB_ENV | |
| - name: Setup Hugo | |
| uses: peaceiris/actions-hugo@v2 | |
| with: | |
| hugo-version: ${{ env.hugovr }} | |
| extended: true | |
| - name: Build 🔧 | |
| env: | |
| HUGO_GMAP_API: ${{ secrets.HUGO_GMAP_API }} | |
| run: | | |
| hugo --minify \ | |
| --baseURL https://${{github.event.number}}--capro-uio.netlify.app | |
| - name: Install netlify cli | |
| run: npm install netlify-cli -g | |
| - name: Deploy preview 🚀 | |
| env: | |
| NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
| NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} | |
| run: | | |
| netlify deploy \ | |
| --dir ./public/ \ | |
| --alias ${{github.event.number}} | |
| shell: sh | |
| - name: Comment PR | |
| uses: thollander/actions-comment-pull-request@v2 | |
| with: | |
| message: | | |
| The PR has been [deployed as a preview](https://${{github.event.number}}--capro-uio.netlify.app). | |
| Please double check it looks ok before merging. | |