try to solve cors error with legends #142
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: Deploy GH Pages | |
| on: | |
| push: | |
| tags: | |
| - '*' | |
| branches: | |
| - lux | |
| pull_request: | |
| branches: | |
| - lux | |
| jobs: | |
| lux-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| fetch-depth: 0 | |
| - uses: actions/setup-node@v3 | |
| with: | |
| node-version: 20 | |
| cache: 'npm' | |
| - name: Install plugins | |
| working-directory: ./plugins | |
| run: | | |
| echo "Installing plugins..." | |
| npm ci --force | |
| - name: Install VCMap-ui | |
| run: | | |
| echo "Installing VCMap-ui..." | |
| npm ci | |
| - name: Get branch name (merge) | |
| if: github.event_name != 'pull_request' | |
| shell: bash | |
| run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | tr / -)" >> $GITHUB_ENV | |
| - name: Get branch name (pull request) | |
| if: github.event_name == 'pull_request' | |
| shell: bash | |
| run: echo "BRANCH_NAME=$(echo ${GITHUB_HEAD_REF} | tr / -)" >> $GITHUB_ENV | |
| - run: npm run build | |
| - run: npm run build-preview | |
| - name: deploy to gh pages | |
| run: | | |
| echo "Deploying to directory: ${{env.BRANCH_NAME}}" | |
| 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/ --dest ${{env.BRANCH_NAME}} --remove "${{env.BRANCH_NAME}}/**" --no-history --dotfiles --repo "https://${GITHUB_ACTOR}:${{secrets.GITHUB_TOKEN}}@github.com/${GITHUB_REPOSITORY}.git" | |
| - name: add PR comment | |
| uses: thollander/actions-comment-pull-request@v1 | |
| if: github.event_name == 'pull_request' | |
| with: | |
| message: 'GitHub Pages links: https://geoportail-luxembourg.github.io/3dviewer/${{env.BRANCH_NAME}}/' | |
| comment_includes: 'GitHub Pages links:' | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |