Skip to content

Deploy React site to Pages #430

Deploy React site to Pages

Deploy React site to Pages #430

Workflow file for this run

name: Deploy React site to Pages
on:
push:
branches:
- gh-pages
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
defaults:
run:
shell: bash
jobs:
build:
runs-on: ubuntu-latest
env:
TZ: America/Los_Angeles
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: "1.24"
- name: Go vet
run: go vet ./...
- name: Go tests
run: go test -race -count=1 ./...
- name: Restore previous history data
run: |
mkdir -p ./public/data
# history.json (existing)
curl -sSf -o /tmp/history.json \
"https://nvidia.github.io/k8s-test-infra/data/history.json" \
&& mv /tmp/history.json ./public/data/history.json \
|| echo '{}' > ./public/data/history.json
# issues_prs.json (new — feeds runIssuesPRsPhase cache fallback)
curl -sSf -o /tmp/issues_prs.json \
"https://nvidia.github.io/k8s-test-infra/data/issues_prs.json" \
&& mv /tmp/issues_prs.json ./public/data/issues_prs.json \
|| echo '{"repos":{}}' > ./public/data/issues_prs.json
- name: Update artifacts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
go run ./artifact_fetcher.go -out ./public/data
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
cache: npm
- name: Install dependencies
run: npm ci
- name: JS tests
run: npm test
- name: Build
run: npm run build
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./dist
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4