Skip to content

Commit 57268d6

Browse files
committed
Update to use github pages
1 parent e826c3c commit 57268d6

File tree

1 file changed

+56
-14
lines changed

1 file changed

+56
-14
lines changed

.github/workflows/docs.yaml

Lines changed: 56 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,53 @@ permissions:
1717
contents: read # for actions/checkout to fetch code
1818

1919
jobs:
20-
staging-release:
21-
permissions:
22-
statuses: write
23-
if: ${{ github.event_name != 'push' && github.repository_owner == 'weaveworks' && !github.event.pull_request.head.repo.fork }}
20+
# staging-release:
21+
# permissions:
22+
# statuses: write
23+
# if: ${{ github.event_name != 'push' && github.repository_owner == 'weaveworks' && !github.event.pull_request.head.repo.fork }}
24+
# runs-on: ubuntu-latest
25+
# defaults:
26+
# run:
27+
# working-directory: website
28+
# steps:
29+
# - uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
30+
# - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
31+
# with:
32+
# node-version: "16.x"
33+
# - name: Build docs
34+
# env:
35+
## GA_KEY: "dummy"
36+
## ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
37+
# NODE_OPTIONS: "--max-old-space-size=4096"
38+
# GITHUB_HEAD_REF: ${{ github.head_ref }}
39+
# run: |
40+
# yarn install --frozen-lockfile
41+
# yarn clear
42+
# export DOC_BASE_URL="/$GITHUB_HEAD_REF/"
43+
# export DOC_URL=https://staging.docs.gitops.weaveworks.org
44+
# export STAGING_BUILD=true
45+
# yarn build
46+
# touch build/.nojekyll
47+
#
48+
# - name: Upload artifact
49+
# uses: actions/upload-pages-artifact@v3
50+
# with:
51+
# name: github-pages
52+
# path: website/build
53+
# retention-days: 365
54+
55+
build:
56+
# Specify runner + build & upload the static files as an artifact
2457
runs-on: ubuntu-latest
25-
defaults:
26-
run:
27-
working-directory: website
2858
steps:
2959
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
3060
- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
3161
with:
3262
node-version: "16.x"
3363
- name: Build docs
3464
env:
35-
# GA_KEY: "dummy"
36-
# ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
65+
# GA_KEY: "dummy"
66+
# ALGOLIA_API_KEY: ${{ secrets.ALGOLIA_API_KEY }}
3767
NODE_OPTIONS: "--max-old-space-size=4096"
3868
GITHUB_HEAD_REF: ${{ github.head_ref }}
3969
run: |
@@ -43,13 +73,25 @@ jobs:
4373
export DOC_URL=https://staging.docs.gitops.weaveworks.org
4474
export STAGING_BUILD=true
4575
yarn build
76+
touch build/.nojekyll
4677
47-
- name: Upload artifact
48-
uses: actions/upload-pages-artifact@v3
78+
- name: Upload static files as artifact
79+
id: deployment
80+
uses: actions/upload-pages-artifact@v3 # or specific "vX.X.X" version tag for this action
4981
with:
50-
name: github-pages
51-
path: website/build
52-
retention-days: 365
82+
path: build_outputs_folder/
83+
84+
# Deployment job
85+
deploy:
86+
environment:
87+
name: github-pages
88+
url: ${{ steps.deployment.outputs.page_url }}
89+
runs-on: ubuntu-latest
90+
needs: build
91+
steps:
92+
- name: Deploy to GitHub Pages
93+
id: deployment
94+
uses: actions/deploy-pages@v4
5395

5496
prod-release:
5597
if: github.event_name != 'pull_request'

0 commit comments

Comments
 (0)