Version 1.52.1 #302
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 π§± and Deploy π³ | |
| on: | |
| push: | |
| branches: [ master ] | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout π³ | |
| uses: actions/[email protected] | |
| - name: Setup node π» | |
| uses: actions/[email protected] | |
| with: | |
| node-version: '20.x' | |
| - name: Add release version to environment variables π | |
| run: | | |
| node -e "console.log('RELEASE_VERSION=' + require('./package.json').version)" >> $GITHUB_ENV | |
| - name: Check if tag already exists π· | |
| id: checkTag | |
| uses: mukunku/[email protected] | |
| with: | |
| tag: ${{ env.RELEASE_VERSION }} | |
| - name: Install npm dependencies π | |
| if: steps.checkTag.outputs.exists == 'false' | |
| run: | | |
| rm package-lock.json | |
| npm cache clear -f | |
| npm install | |
| rm -rf public/dumps/ | |
| rm -rf public/env.json | |
| mv public/env-pages.json public/env.json | |
| - name: Build for pages π | |
| if: steps.checkTag.outputs.exists == 'false' | |
| env: | |
| NEXT_PUBLIC_UMAMI_SRC: https://cloud.umami.is/script.js | |
| NEXT_PUBLIC_UMAMI_WEBSITE_ID: ${{ secrets.NEXT_PUBLIC_UMAMI_WEBSITE_ID }} | |
| NEXT_PUBLIC_DROPBOX_APP_KEY: ${{ secrets.NEXT_PUBLIC_DROPBOX_APP_KEY }} | |
| NEXT_PUBLIC_DROPBOX_APP_PATH: ${{ secrets.NEXT_PUBLIC_DROPBOX_APP_PATH }} | |
| NEXT_PUBLIC_ENV_ENDPOINT: ${{ secrets.NEXT_PUBLIC_ENV_ENDPOINT }} | |
| NEXT_PUBLIC_BASE_PATH: /gb-printer-web | |
| run: | | |
| npm run build | |
| touch out/.nojekyll | |
| mv out out-pages | |
| - name: Deploy to GitHub-Pages π | |
| uses: JamesIves/[email protected] | |
| if: steps.checkTag.outputs.exists == 'false' | |
| with: | |
| branch: gh-pages | |
| folder: out-pages | |
| - name: Build for release zip π | |
| if: steps.checkTag.outputs.exists == 'false' | |
| env: | |
| NEXT_PUBLIC_DROPBOX_APP_KEY: ${{ secrets.NEXT_PUBLIC_DROPBOX_APP_KEY }} | |
| NEXT_PUBLIC_ENV_ENDPOINT: ${{ secrets.NEXT_PUBLIC_ENV_ENDPOINT }} | |
| NEXT_PUBLIC_BASE_PATH: "" | |
| run: | | |
| npm run build | |
| mv o o-zip | |
| - name: Create data_w.zip for release π | |
| if: steps.checkTag.outputs.exists == 'false' | |
| run: | | |
| cd o-zip | |
| zip -r ../data_w.zip * | |
| cd .. | |
| - name: Create Release π π₯³ | |
| uses: softprops/[email protected] | |
| if: steps.checkTag.outputs.exists == 'false' | |
| with: | |
| tag_name: ${{ env.RELEASE_VERSION }} | |
| name: Version ${{ env.RELEASE_VERSION }} | |
| files: data_w.zip |