Skip to content

Update showcases index #128

Update showcases index

Update showcases index #128

name: Publish Website
on:
push:
branches:
- master
env:
# Used by docusaurus `publish-site` step
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO_NAME: ${{ github.event.repository.name }}
jobs:
publish-website:
name: Publish Website
# There is currently no way to limit workflow dispatch to only allow default branch
# so we need to restrict it here
# See https://github.community/t/limit-branch-for-workflow-dispatch/122099
if: github.ref == 'refs/heads/master' && github.repository == 'finos/legend'
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/[email protected]
- name: Setup Node
uses: actions/[email protected]
with:
node-version: 21
- name: Prepare static artifacts
run: |
cp -r installers/omnibus/scripts/* website/static/omnibus
- name: Build Website
working-directory: ./website
run: |
npm install
npm run build
- name: Search for Broken Links
run: |
node ./scripts/check-legend-application-documentation-broken-links.js
- name: Publish Website
if: github.repository == 'finos/legend' # skip running action in forks
run: |
# Extract GitHub org/user
REPO="${{ github.repository }}"
GIT_USERNAME=${REPO%/*}
# Set git user to finos, if it's a push to a finos repo
if [ "$GIT_USERNAME" == "finos" ] && [ "${{github.event_name }}" == "push" ]
then GIT_USERNAME="finos"
elif [ "$GIT_USERNAME" == "finos" ] && [ "${{github.event_name }}" == "pull_request" ]
then echo "Skipping publishing, as it's coming from a PR"; exit 0
fi
# Configure git client
echo "Git repo - $REPO"
echo "Git user - $GIT_USERNAME"
git config --global user.email "[email protected]"
git config --global user.name "$GIT_USERNAME"
echo "machine github.com login $GIT_USERNAME password $GITHUB_TOKEN" > ~/.netrc
GIT_USER=$GIT_USERNAME npm run deploy --prefix website