Skip to content

Commit 3d56f2b

Browse files
committed
Set up GitHub Pages
1 parent ddd8d72 commit 3d56f2b

1 file changed

Lines changed: 69 additions & 0 deletions

File tree

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: Deploy GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
# Allows running this workflow manually from the Actions tab.
9+
workflow_dispatch:
10+
11+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages.
12+
permissions:
13+
contents: read
14+
pages: write
15+
id-token: write
16+
17+
# Allow only one concurrent run, skipping runs queued between the run
18+
# in-progress and latest queued. However, don't cancel in-progress runs as it's
19+
# fine to let them complete, and this way we have fewer reports of canceled
20+
# runs.
21+
concurrency:
22+
group: deploy-github-pages
23+
cancel-in-progress: false
24+
25+
jobs:
26+
deploy-github-pages:
27+
# Only run this job on the original repository! To run this on your fork,
28+
# update or remove the line below.
29+
if: github.repository == 'code-chronicles-code/react-rock-paper-scissors'
30+
31+
environment:
32+
name: deploy-github-pages
33+
url: ${{ steps.deployment.outputs.page_url }}
34+
35+
runs-on: ubuntu-latest
36+
37+
steps:
38+
- name: Check out repository
39+
uses: actions/checkout@v4
40+
41+
- name: Set up Node
42+
uses: actions/setup-node@v4
43+
with:
44+
# TODO: replace with latest, it was causing some Yarn checksum issues recently though
45+
node-version: 22.6.0
46+
cache: yarn
47+
cache-dependency-path: ./yarn.lock
48+
49+
- name: Install dependencies
50+
run: yarn --immutable
51+
shell: bash
52+
53+
- name: Build app
54+
run: yarn build
55+
env:
56+
NODE_ENV: production
57+
PUBLIC_URL: /react-rock-paper-scissors/
58+
59+
- name: Set up Pages
60+
uses: actions/configure-pages@v5
61+
62+
- name: Upload artifact
63+
uses: actions/upload-pages-artifact@v3
64+
with:
65+
path: ./build
66+
67+
- name: Deploy to GitHub Pages
68+
id: deployment
69+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)