Merge pull request #176 from physicshub/dependabot/npm_and_yarn/husky… #164
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: Release and Build | |
| on: | |
| push: | |
| branches: ["main"] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| issues: write | |
| pull-requests: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| release-and-build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "20" | |
| cache: "npm" | |
| - name: Install dependencies | |
| run: npm install --legacy-peer-deps | |
| # 1. Tenta la release (se non ci sono fix/feat semplicemente non crea il tag) | |
| - name: Semantic Release | |
| env: | |
| GH_TOKEN: ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }} | |
| run: npx semantic-release | |
| # 2. Configura Pages (Sempre eseguito) | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v5 | |
| # 3. Build (Sempre eseguito) | |
| - name: Build with Next.js | |
| env: | |
| NEXT_PUBLIC_DISCORD_WEBHOOK_URL_FEEDBACK: ${{ secrets.NEXT_PUBLIC_DISCORD_WEBHOOK_URL_FEEDBACK }} | |
| run: npm run build | |
| # 4. Carica Artifact (Sempre eseguito) | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: ./out | |
| deploy: | |
| needs: release-and-build | |
| # Rimosso il controllo if: ora parte sempre dopo il build | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |