Merge pull request #170 from sergiocarracedo/feat/revamp #8
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: Deploy Pages | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "30 16 * * *" | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: true | |
| env: | |
| PUBLIC_BASE_PATH: ${{ vars.PUBLIC_BASE_PATH }} | |
| PUBLIC_NOINDEX: ${{ vars.PUBLIC_NOINDEX || 'true' }} | |
| jobs: | |
| refresh-data: | |
| if: github.actor != 'github-actions[bot]' | |
| permissions: | |
| contents: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '22' | |
| cache: pnpm | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v5 | |
| with: | |
| version: 10 | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Generate vigotech data | |
| run: pnpm generate:data | |
| env: | |
| EVENTBRITE_OAUTH_TOKEN: ${{ secrets.EVENTBRITE_OAUTH_TOKEN }} | |
| YOUTUBE_API_KEY: ${{ secrets.YOUTUBE_API_KEY }} | |
| - name: Sync Astro content types | |
| run: pnpm astro sync | |
| - name: Format generated content | |
| run: pnpm format src/content/events src/content/videos | |
| - name: Commit generated data | |
| run: | | |
| if git diff --quiet -- public/vigotech-generated.json src/content/videos src/content/events; then | |
| echo "No generated changes to commit" | |
| exit 0 | |
| fi | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add public/vigotech-generated.json src/content/videos src/content/events | |
| git commit -m "chore: refresh generated community history" --no-verify | |
| git push | |
| build: | |
| needs: refresh-data | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '22' | |
| cache: pnpm | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v5 | |
| with: | |
| version: 10 | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Generate vigotech data | |
| run: pnpm generate:data | |
| env: | |
| EVENTBRITE_OAUTH_TOKEN: ${{ secrets.EVENTBRITE_OAUTH_TOKEN }} | |
| YOUTUBE_API_KEY: ${{ secrets.YOUTUBE_API_KEY }} | |
| - name: Build site | |
| run: pnpm build | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@v4 | |
| with: | |
| path: ./dist | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v5 |