released #1184
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
name: Publish catalog | |
# Controls when the action will run. Triggers the workflow on push or pull request | |
# events but only for the main branch | |
on: | |
push: | |
branches: [ main ] | |
repository_dispatch: | |
types: [ released ] | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
publish: | |
# if: ${{ github.event_name == 'push' }} | |
runs-on: ubuntu-latest | |
env: | |
DIST_DIR: ./build | |
PUBLISH_BRANCH: gh-pages | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Install yq | |
run: | | |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CC86BB64 | |
sudo add-apt-repository ppa:rmescandon/yq | |
sudo apt update | |
sudo apt install yq -y | |
- name: Install jq | |
run: | | |
curl -Lo jq https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 | |
chmod +x jq | |
sudo mv jq /usr/local/bin | |
- name: Setup NodeJS | |
uses: actions/setup-node@v2-beta | |
with: | |
node-version: '16' | |
registry-url: https://registry.npmjs.org/ | |
- name: Build Catalog UI | |
run: | | |
npm ci | |
CI=false npm run build | |
- name: Build Catalog YAML | |
run: | | |
./.github/scripts/build-catalog.sh ${{ env.DIST_DIR }} | |
- name: Set up markdown | |
run: | | |
cp -R md ${{ env.DIST_DIR }} | |
- name: Set up schemas | |
run: | | |
cp -R schemas ${{ env.DIST_DIR }} | |
- name: Set up interfaces | |
run: | | |
cp -R interfaces ${{ env.DIST_DIR }} | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ${{ env.DIST_DIR }} | |
publish_branch: ${{ env.PUBLISH_BRANCH }} | |
enable_jekyll: false | |
cname: modules.cloudnativetoolkit.dev |