-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #96 from deerskindoll/main
chore: new publication builder workflow
- Loading branch information
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Che website publication builder | ||
|
||
# Define when the workflow runs. | ||
on: | ||
# Pass secrets to make it a reusable workflow (that che-docs calls). | ||
workflow_call: | ||
secrets: | ||
CHE_BOT_GITHUB_TOKEN: | ||
required: true | ||
# Run on push on the main branch. | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build: | ||
name: Publication builder | ||
runs-on: ubuntu-20.04 | ||
container: node:16.14.0-bullseye | ||
steps: | ||
- name: Checkout the website repository | ||
uses: actions/checkout@v4 | ||
- name: Checkout the docs repository | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: eclipse-che/che-docs | ||
ref: publication # Fetch the publication branch. | ||
path: public # Fetch to the public directory. | ||
sparse-checkout: . # Fetch only the root files. | ||
- name: Generate Che website | ||
# Install dependencies. Build website. Copy build results from build/che to public/ directory. | ||
run: | | ||
yarn | ||
yarn build | ||
cp -r build/che/* public/ | ||
- name: Commit to publication branch | ||
uses: peaceiris/actions-gh-pages@v3 | ||
with: | ||
commit_message: "Publication at ${{ steps.get-date.outputs.timestamp }}" | ||
force_orphan: true # Keep only the latest commit in the branch | ||
github_token: ${{ secrets.CHE_BOT_GITHUB_TOKEN }} | ||
publish_branch: publication # Publish to the publication branch | ||
publish_dir: public # Publish the public directory |