-
Notifications
You must be signed in to change notification settings - Fork 3.5k
[CI] Add github workflow for updating the website. NFC #25793
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| name: Update website | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ main ] | ||
|
|
||
| jobs: | ||
| update-website: | ||
| name: Update website | ||
| runs-on: ubuntu-latest | ||
| env: | ||
| GH_TOKEN: ${{ secrets.EMSCRIPTEN_BOT_TOKEN }} | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the emscripten-site repo will accept PRs from any random person on github, then I don't see why emscripten-bot should be different. If we need to give emscripten-bot some permission to let CI on the site run, we could do that. But it shouldn't require actually putting the bot's token in the repo as a secret. That would only be needed if we want something to run as the bot. |
||
| steps: | ||
| - name: Checkout repo | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| submodules: true | ||
| - name: Checkout website repo | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| repository: kripken/emscripten-site | ||
| ref: gh-pages | ||
| path: ../emscripten-site | ||
| - name: pip install | ||
| run: | | ||
| which python3 | ||
| python3 --version | ||
| python3 -m pip install -r requirements-dev.txt | ||
| - name: Update docs | ||
| run: | | ||
| git config user.name emscripten-bot | ||
| git config user.email emscripten-bot@users.noreply.github.com | ||
| ./bootstrap | ||
| if ./tools/maint/update_docs.py; then | ||
| echo "rebaseline_tests returned zero, expectations up-to-date" | ||
| # Exit early and don't create a PR | ||
| exit 0 | ||
| else | ||
| code=$? | ||
| if [[ $code != 2 ]] ; then | ||
| echo "rebaseline_docs.py failed with unexpected error $code (expected 2)" | ||
| exit 1 | ||
| fi | ||
| fi | ||
| # Create a PR against the emscripten-site repo | ||
| cd ../emscripten-site | ||
| git push origin update | ||
| gh pr create --fill --base gh-pages --reviewer sbc100,kripken | ||
| gh pr merge --squash --auto | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.