Repository navigation
87 lines (76 loc) · 2.7 KB
/
Copy pathdeploy-pages.yml
File metadata and controls
87 lines (76 loc) · 2.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: Deploy site to GitHub Pages
# Public site (Jekyll, frontend/public-site/) at / and the static member portal demo (Next.js) at /portal/.
on:
push:
branches: [main]
schedule:
- cron: '0 22 * * *' # daily at 06:00 Philippine time, to refresh PyTorch news
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: actions/setup-node@v4
with:
node-version: '22'
cache: npm
cache-dependency-path: |
package-lock.json
frontend/public-site/package-lock.json
- name: Build the member portal demo
env:
NEXT_PUBLIC_AUTH_API_ORIGIN: https://api.pytorch.ph
NEXT_PUBLIC_API_ORIGIN: https://api.pytorch.ph
NEXT_PUBLIC_GOOGLE_CLIENT_ID: ${{ vars.GOOGLE_CLIENT_ID }}
run: |
npm ci --no-audit --no-fund
npm run build:pages
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.4.5'
bundler-cache: true
working-directory: frontend/public-site
- name: Build the public site
working-directory: frontend/public-site
env:
JEKYLL_ENV: production
PUBLIC_SITE_FACEBOOK_URL: ${{ vars.PUBLIC_SITE_FACEBOOK_URL }}
PUBLIC_SITE_LINKEDIN_URL: ${{ vars.PUBLIC_SITE_LINKEDIN_URL }}
PUBLIC_SITE_CONTACT_EMAIL: ${{ vars.PUBLIC_SITE_CONTACT_EMAIL }}
JEKYLL_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm ci --no-audit --no-fund
mkdir -p assets/vendor
cp node_modules/jquery/dist/jquery.min.js node_modules/@popperjs/core/dist/umd/popper.min.js node_modules/anchor-js/anchor.min.js assets/vendor/
cp node_modules/bootstrap/dist/js/bootstrap.bundle.min.js assets/vendor/bootstrap.min.js
node scripts/prepare-site-content.mjs
node scripts/fetch-pytorch-news.mjs
bundle exec jekyll build
- name: Assemble the Pages artifact
run: |
test ! -e frontend/public-frontend/public-site/_site/portal
cp -r frontend/portal-static/out frontend/public-site/_site/portal
touch frontend/public-site/_site/.nojekyll
- uses: actions/configure-pages@v5
- uses: actions/upload-pages-artifact@v4
with:
path: frontend/public-site/_site
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4