Skip to content

Commit

Permalink
ci: fix md-converter deploy on gh-pages
Browse files Browse the repository at this point in the history
Also fix links in README & add link to the md converter app
  • Loading branch information
jahow committed Oct 7, 2024
1 parent a9a88e9 commit 93bd631
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 34 deletions.
38 changes: 6 additions & 32 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
gh-pages:
needs: checks
if: github.event_name != 'issue_comment' || needs.checks.outputs.shouldRun
name: Deploy Storybook to GitHub Pages
name: Deploy docs, apps, Storybook to GitHub Pages
runs-on: ubuntu-latest
env:
BRANCH_NAME: ${{needs.checks.outputs.ref || 'main'}}
Expand Down Expand Up @@ -78,6 +78,10 @@ jobs:
- name: Build demo & web components
run: npm run build:demo

- name: Build metadata-converter app
if: github.event_name != 'issue_comment' # This is not done on PR, only on main branch
run: npx nx build metadata-converter --prod --base-href=./

- name: Build docs
run: npm run docs:build -- --base=/geonetwork-ui/${{env.BRANCH_NAME}}/docs/ && mkdir -p dist/docs && mv docs/.vitepress/dist/* dist/docs

Expand All @@ -99,39 +103,9 @@ jobs:
* (Documentation)[https://geonetwork.github.io/geonetwork-ui/${{env.BRANCH_NAME}}/docs/]
* (Demo & web components)[https://geonetwork.github.io/geonetwork-ui/${{env.BRANCH_NAME}}/demo/]
* (Web components demo)[https://geonetwork.github.io/geonetwork-ui/${{env.BRANCH_NAME}}/demo/webcomponents/]
* (UI components storybook)[https://geonetwork.github.io/geonetwork-ui/${{env.BRANCH_NAME}}/storybook/demo/]'
comment_tag: github-links
pr_number: ${{ github.event.issue.number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

apps:
needs: checks
if: github.event_name != 'issue_comment'
name: Deploy Apps to GitHub Pages
runs-on: ubuntu-latest
env:
BRANCH_NAME: main

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'

- name: Install
run: npm ci

- name: Build metadata-converter
run: npx nx build metadata-converter --prod

- name: Deploy to directory ${{ env.BRANCH_NAME }}
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
npx gh-pages --dist dist/apps/ --dest ${{env.BRANCH_NAME}} --remove "${{env.BRANCH_NAME}}/**" --no-history --repo "https://${GITHUB_ACTOR}:${{secrets.GITHUB_TOKEN}}@github.com/${GITHUB_REPOSITORY}.git"
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ You can start it with `npm run storybook`.
You can either try complete applications or showcases of components using the following links:

- [Storybook of UI components](https://geonetwork.github.io/geonetwork-ui/main/storybook/demo/)
- [Storybook of Web components](https://geonetwork.github.io/geonetwork-ui/main/storybook-wc/)
- [Demo](https://geonetwork.github.io/geonetwork-ui/main/demo/)
- [Metadata Converter app](https://geonetwork.github.io/geonetwork-ui/main/metadata-converter/)
- [Web Components demo](https://geonetwork.github.io/geonetwork-ui/main/demo/webcomponents/)

## More information

Expand Down

0 comments on commit 93bd631

Please sign in to comment.