Bump vite from 5.0.12 to 5.0.13 #60
This file contains 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
# The site is built on branch `dist`, in folder `docs`, | |
# which makes the build compatible with Github Pages and Netlify | |
name: Build website | |
on: | |
push: | |
branches: | |
- main | |
- staging/** | |
workflow_dispatch: | |
permissions: | |
contents: write | |
concurrency: | |
group: "build-website" | |
cancel-in-progress: true | |
jobs: | |
build-website: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: echo "nvmrc=$(cat .nvmrc)" >> $GITHUB_ENV | |
id: nvmrc | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "${{ env.nvmrc }}" | |
cache: npm | |
- run: npm ci | |
- run: echo "APP_VERSION=$(jq -r '.version' package.json)" >> $GITHUB_ENV | |
id: APP_VERSION | |
- run: echo "BRANCH=$([[ "$(git branch --show-current)" == "main" ]] && echo "dist" || echo "staging/dist")" >> $GITHUB_ENV | |
id: BRANCH | |
- run: echo "SENTRY_ENVIRONMENT=$([[ "${{ env.BRANCH }}" == "dist" ]] && echo "production" || echo "staging")" >> $GITHUB_ENV | |
id: SENTRY_ENVIRONMENT | |
- env: | |
DOMAIN: "${{ secrets.DOMAIN }}" | |
run: sed -i "s/\$DOMAIN/${{ env.DOMAIN }}/" index.html | |
- env: | |
ENVIRONMENT: "${{ env.SENTRY_ENVIRONMENT }}" | |
APP_VERSION: "${{ env.APP_VERSION }}" | |
DOMAIN: "${{ secrets.DOMAIN }}" | |
SENTRY_INGEST: "${{ secrets.SENTRY_INGEST }}" | |
PLAUSIBLE_API_URL: "${{ secrets.PLAUSIBLE_API_URL }}" | |
PB_INSTANCES: "${{ secrets.PB_INSTANCES }}" | |
run: npm run build | |
- run: | | |
git checkout index.html | |
[[ "${{ env.BRANCH }}" != "dist" ]] && git fetch && git branch main remotes/origin/main | |
git switch --orphan ${{ env.BRANCH }} | |
git checkout main docs.gitignore netlify.toml | |
mv -v docs.gitignore .gitignore | |
git rm docs.gitignore | |
git add .gitignore docs | |
git config user.name "Zwyx - GitHub Actions" | |
git config user.email "29386932+Zwyx@users.noreply.github.com>" | |
git commit -m "Build website" | |
git push --set-upstream origin --force ${{ env.BRANCH }} | |
# | |
# - name: Setup tmate session | |
# if: ${{ always() }} | |
# timeout-minutes: 30 # Run `sudo shutdown -h now` to terminate the session | |
# env: | |
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# uses: mxschmitt/action-tmate@v3 |