Skip to content

Commit 6a7a2d8

Browse files
committed
Deploy to github pages.
1 parent f81ee2c commit 6a7a2d8

1 file changed

Lines changed: 79 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,82 @@ jobs:
8585
# - name: Set up PowerShell
8686
# uses: actions/setup-powershell@v2
8787

88+
deploy_github_pages:
89+
runs-on: windows-latest
90+
needs: [build, publish]
91+
permissions:
92+
contents: write
93+
pages: write
94+
id-token: write
95+
96+
steps:
97+
- name: Download Wasm Artifact
98+
uses: actions/download-artifact@v4
99+
with:
100+
name: codex.web.wasm
101+
path: ./site-source
102+
103+
- name: Download Codex.exe Artifact
104+
uses: actions/download-artifact@v4
105+
with:
106+
name: codex
107+
path: ./codex
108+
109+
- name: Create WASM deployment
110+
shell: pwsh
111+
run: ./codex/codex.exe deployweb -s ./site-source -t ./site -h pages -m wasm -i index
112+
113+
- name: Download Index Artifact
114+
uses: actions/download-artifact@v4
115+
with:
116+
name: index
117+
path: ./site/index
118+
119+
- name: Setup Pages
120+
uses: actions/configure-pages@v4
121+
122+
- name: Upload to GitHub Pages
123+
uses: actions/upload-pages-artifact@v3
124+
with:
125+
path: ./site
126+
127+
- name: Deploy to GitHub Pages
128+
id: deployment
129+
uses: actions/deploy-pages@v4
130+
131+
# deploy_external_repo:
132+
# runs-on: ubuntu-latest
133+
# needs: publish
134+
# steps:
135+
# - name: Download Wasm Artifact
136+
# uses: actions/download-artifact@v4
137+
# with:
138+
# name: codex.web.wasm
139+
# path: ./wasm-artifact
140+
141+
# - name: Set up Git
142+
# run: |
143+
# git config --global user.name "github-actions[bot]"
144+
# git config --global user.email "github-actions[bot]@users.noreply.github.com"
145+
146+
# - name: Clone codex-pages repository
147+
# run: |
148+
# git clone --single-branch --branch github-pages https://github.com/Ref12/codex-pages codex-pages
149+
150+
# - name: Clear existing content
151+
# run: |
152+
# shopt -s dotglob
153+
# rm -rf codex-pages/*
154+
155+
# - name: Copy artifact contents
156+
# run: |
157+
# cp -r ./wasm-artifact/* codex-pages/
158+
159+
# - name: Commit and push changes
160+
# env:
161+
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
162+
# run: |
163+
# cd external-pages
164+
# git add .
165+
# git commit -m "Update github-pages branch with latest wasm artifact" || echo "No changes to commit"
166+
# git push https://x-access-token:${GH_TOKEN}@github.com/Ref12/codex-pages.git github-pages

0 commit comments

Comments
 (0)