Skip to content

Commit d65c89a

Browse files
committed
Update publishing workflow to layer current build and playground on top of historical releases
1 parent c7e8194 commit d65c89a

File tree

1 file changed

+62
-6
lines changed

1 file changed

+62
-6
lines changed

.github/workflows/main.yaml

Lines changed: 62 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,49 +11,105 @@ jobs:
1111
runs-on: ubuntu-latest
1212
name: Test and Deploy Playground
1313
steps:
14-
- uses: actions/checkout@v3
14+
# Checkout the content from the `releases` branch
15+
- name: Checkout releases branch
16+
uses: actions/checkout@v3
17+
with:
18+
ref: releases
19+
path: base_content
20+
21+
# Checkout the current branch (to get the latest changes)
22+
- name: Checkout current branch
23+
uses: actions/checkout@v3
24+
with:
25+
path: current_branch
26+
27+
# Install Ruby for Jekyll
1528
- uses: ruby/setup-ruby@v1
1629
with:
1730
ruby-version: '3.0'
18-
- run: export GEM_HOME="$HOME/gems" && export PATH="$HOME/gems/bin:$PATH" && gem install jekyll bundler
19-
- run: export GEM_HOME="$HOME/gems" && export PATH="$HOME/gems/bin:$PATH" && jekyll -h
31+
32+
- run: |
33+
export GEM_HOME="$HOME/gems"
34+
export PATH="$HOME/gems/bin:$PATH"
35+
gem install jekyll bundler
36+
37+
# Set up Bun for JavaScript dependencies
2038
- uses: oven-sh/setup-bun@v1
2139
with:
2240
bun-version: latest
41+
42+
# Install Java
2343
- name: install java
2444
uses: actions/setup-java@v3
2545
with:
2646
distribution: 'adopt'
2747
java-version: 17
48+
49+
# Set up Node.js
2850
- uses: actions/setup-node@v3
2951
with:
3052
node-version: 18
53+
54+
# Install dependencies for sof-js
3155
- name: Install dependencies
3256
working-directory: sof-js
3357
run: bun install
58+
59+
# Run code formatting checks
3460
- name: Check formatting
3561
working-directory: sof-js
3662
run: bun run check-fmt
63+
64+
# Validate JSON tests
3765
- name: Validate JSON tests
3866
working-directory: sof-js
3967
run: bun run validate
68+
69+
# Run tests
4070
- name: Run tests
4171
working-directory: sof-js
4272
run: bun run test
4373
continue-on-error: true
74+
75+
# Build test report and output to playground directory
4476
- name: Build test report
4577
working-directory: test_report
46-
run: bun install && bun run prepare && bun run build
78+
run: |
79+
bun install
80+
bun run prepare
81+
bun run build
82+
# Copy test_report output to the playground directory in the base content
83+
- run: |
84+
mkdir -p base_content/playground
85+
cp -R test_report/public/* base_content/playground/
86+
87+
# Build IG and output to ig/latest directory
4788
- name: Build IG
48-
run: export GEM_HOME="$HOME/gems" && export PATH="$HOME/gems/bin:$HOME/.bun/bin:$PATH" && bun i -g fsh-sushi && ./scripts/_updatePublisher.sh -y && ./scripts/_genonce.sh && cp -R test_report/public output/extra
89+
run: |
90+
export GEM_HOME="$HOME/gems"
91+
export PATH="$HOME/gems/bin:$HOME/.bun/bin:$PATH"
92+
bun i -g fsh-sushi
93+
./scripts/_updatePublisher.sh -y
94+
./scripts/_genonce.sh
95+
# Copy IG output to the ig/latest directory in the base content
96+
- run: |
97+
mkdir -p base_content/ig/latest
98+
cp -R output/* base_content/ig/latest/
99+
100+
# Set up Pages for deployment
49101
- name: Setup Pages
50102
uses: actions/configure-pages@v3
51103
if: ${{ github.ref == 'refs/heads/master' }}
104+
105+
# Upload the artifact (base_content) for deployment
52106
- name: Upload artifact
53107
uses: actions/upload-pages-artifact@v2
54108
if: ${{ github.ref == 'refs/heads/master' }}
55109
with:
56-
path: 'output'
110+
path: 'base_content'
111+
112+
# Deploy to GitHub Pages
57113
- name: Deploy to GitHub Pages
58114
id: deployment
59115
uses: actions/deploy-pages@v2

0 commit comments

Comments
 (0)