name: Build and Deploy Demo on Release on: release: types: [published] permissions: contents: read pages: write id-token: write jobs: build: runs-on: ubuntu-latest if: github.event.release.target_commitish == 'main' # Filters for releases from main branch steps: - name: Checkout code uses: actions/checkout@v4 with: fetch-depth: 0 - name: Install Yarn run: npm install --global yarn - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: 20 cache: "yarn" - name: Install dependencies and build run: yarn && URL_BASE_PATH=/jelly-app/ yarn build && cp dist/index.html dist/404.html - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: path: ./dist deploy: runs-on: ubuntu-latest needs: build if: needs.build.result == 'success' environment: name: github-pages steps: - name: Deploy to GitHub Pages uses: actions/deploy-pages@v4