Skip to content

Merge pull request #169 from sergiocarracedo/feat/revamp #6

Merge pull request #169 from sergiocarracedo/feat/revamp

Merge pull request #169 from sergiocarracedo/feat/revamp #6

Workflow file for this run

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:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
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@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: echo "STORE_PATH=$(pnpm store path)" >> "$GITHUB_OUTPUT"
- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- 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@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: echo "STORE_PATH=$(pnpm store path)" >> "$GITHUB_OUTPUT"
- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- 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@v3
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@v4