Skip to content

Commit 267bf26

Browse files
authored
[CI job] Swap steps to fix publication to gh-pages (#313)
Publication to `gh-pages` currently fails because the w3c/spec-prod action cannot find the `.git/config` file when it looks for it. The action runs smoothly on a number of other repositories with very similar settings, and manages to publish the spec to /TR without any problem. One explanation could be that the step that copies static file somehow modifies the local state (and drops the `.git` folder). This update swaps the steps to run the spec generation job first and deployment of static files last.
1 parent fad5d8a commit 267bf26

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,6 @@ jobs:
1919
- name: Checkout repository
2020
uses: actions/checkout@v2
2121

22-
# If event is a push to main branch (and not a pull request),
23-
# copy static files over to the gh-pages branch, excluding files
24-
# that don't need to be published, and preserving older versions
25-
# of the spec that are in the gh-pages branch.
26-
- name: Deploy static files
27-
if: ${{ github.ref == 'refs/heads/main' }}
28-
uses: peaceiris/[email protected]
29-
with:
30-
github_token: ${{ secrets.GITHUB_TOKEN }}
31-
publish_dir: ./
32-
exclude_assets: '.github,*.md,*.json,media-source-respec.html'
33-
keep_files: true
34-
3522
# Run spec-prod action to build, validate the spec itself and,
3623
# if event is a push, deploy it both to the gh-pages branch and
3724
# to w3.org/TR
@@ -45,4 +32,21 @@ jobs:
4532
W3C_ECHIDNA_TOKEN: ${{ secrets.ECHIDNA_TOKEN }}
4633
W3C_WG_DECISION_URL: https://github.com/w3c/media-wg/issues/27
4734
W3C_BUILD_OVERRIDE: |
48-
specStatus: WD
35+
specStatus: WD
36+
37+
# If event is a push to main branch (and not a pull request),
38+
# copy static files over to the gh-pages branch, excluding files
39+
# that don't need to be published, and preserving older versions
40+
# of the spec that are in the gh-pages branch.
41+
# Note: Step needs to take place after spec-prod step because the
42+
# w3c/spec-prod action expects local state to be clean and the
43+
# peaceiris/actions-gh-pages seems to change it in such a way that the
44+
# w3c/spec-prod can no longer find the .git/config file.
45+
- name: Deploy static files
46+
if: ${{ github.ref == 'refs/heads/main' }}
47+
uses: peaceiris/[email protected]
48+
with:
49+
github_token: ${{ secrets.GITHUB_TOKEN }}
50+
publish_dir: ./
51+
exclude_assets: '.github,*.md,*.json,media-source-respec.html'
52+
keep_files: true

0 commit comments

Comments
 (0)