Merge pull request #3 from j-medland/main #47
This file contains hidden or 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
name: Build website UIs | |
on: | |
push: | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
concurrency: | |
group: github-pages | |
cancel-in-progress: false | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
#build en website | |
- name: Install Gulp locally to build the UI | |
run: npm i gulp-cli ./en | |
- name: Build en UI | |
run: gulp bundle -f ./en/gulpfile.js | |
- name: Move built folder to _public | |
run: mv en/build/ui-bundle.zip _public/en/ | |
# build fr website | |
- name: Install Gulp locally to build the UI | |
run: npm i gulp-cli ./fr | |
- name: Build fr UI | |
run: gulp bundle -f ./fr/gulpfile.js | |
- name: Move built folder to _public | |
run: mv fr/build/ui-bundle.zip _public/fr/ | |
# build es website | |
- name: Install Gulp locally to build the UI | |
run: npm i gulp-cli ./es | |
- name: Build es UI | |
run: gulp bundle -f ./es/gulpfile.js | |
- name: Move built folder to _public | |
run: mv es/build/ui-bundle.zip _public/es/ | |
# build zh website | |
- name: Install Gulp locally to build the UI | |
run: npm i gulp-cli ./zh | |
- name: Build zh UI | |
run: gulp bundle -f ./zh/gulpfile.js | |
- name: Move built folder to _public | |
run: mv zh/build/ui-bundle.zip _public/zh/ | |
# download UIs | |
- name: Upload GitHub Pages Artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: _public | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 | |
# force building the website with the new UIs | |
- name: Trigger Workflow in Another Repository | |
run: | | |
repo_owner="LabVIEWCommunityTraining" | |
repo_name="www" | |
workflow_file="publish-website-on-gh-pages.yml" | |
branch="main" | |
json_data="{\"ref\": \"$branch\"}" | |
curl -L \ | |
-X POST \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: Bearer ${{ secrets.WEBSITE_DELIVERY_TRIGGER }}" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
https://api.github.com/repos/$repo_owner/$repo_name/actions/workflows/$workflow_file/dispatches \ | |
-d "$json_data" |