Merge pull request #3004 from terrestris/add-e2e-reporter #2437
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: Update gh-pages (latest) | |
| env: | |
| DOCKER_REGISTRY: hub.terrestris.de/shogun | |
| on: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout sources ๐ฐ | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | |
| - name: Setup Node.js ๐งฎ | |
| uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6 | |
| with: | |
| node-version: 24 | |
| - name: Cache Node.js modules ๐พ | |
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6 | |
| with: | |
| path: ~/.npm | |
| key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.OS }}-node- | |
| ${{ runner.OS }}- | |
| - name: Install dependencies โฌ | |
| run: npm ci | |
| - name: Build artifacts ๐๏ธ | |
| run: npm run build | |
| - name: Deploy (to latest) ๐ | |
| uses: JamesIves/github-pages-deploy-action@d92aa235d04922e8f08b40ce78cc5442fcfbfa2f # v4.8.0 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| branch: gh-pages | |
| folder: build | |
| target-folder: latest | |
| - name: Login to Docker Registry โจ๏ธ | |
| uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4 | |
| with: | |
| registry: ${{ env.DOCKER_REGISTRY }} | |
| username: ${{ secrets.DOCKER_REGISTRY_USER }} | |
| password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }} | |
| - name: Build docker image (main) ๐๏ธ | |
| uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7 | |
| with: | |
| context: . | |
| tags: | | |
| ${{ env.DOCKER_REGISTRY }}/shogun-gis-client:main | |
| load: true | |
| - name: Push docker image to Docker Registry (main) ๐ | |
| run: | | |
| docker push ${{ env.DOCKER_REGISTRY }}/shogun-gis-client:main | |
| - name: Build docker image e2e-tests (latest) ๐๏ธ | |
| uses: docker/build-push-action@53b7df96c91f9c12dcc8a07bcb9ccacbed38856a # v7 | |
| with: | |
| file: Dockerfile.e2e | |
| context: . | |
| tags: | | |
| ${{ env.DOCKER_REGISTRY }}/shogun-gis-client-e2e-tests:latest | |
| load: true | |
| - name: Push docker image e2e-tests to Docker Registry (latest) ๐ | |
| run: | | |
| docker push ${{ env.DOCKER_REGISTRY }}/shogun-gis-client-e2e-tests:latest | |
| sonarqube: | |
| if: ${{ github.actor != 'dependabot[bot]' }} | |
| name: SonarQube Trigger | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout sources ๐ฐ | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | |
| with: | |
| # Disabling shallow clone is recommended for improving relevancy of reporting | |
| fetch-depth: 0 | |
| - name: Setup Node.js ๐งฎ | |
| uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6 | |
| with: | |
| node-version: 24 | |
| - name: Cache Node.js modules ๐พ | |
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6 | |
| with: | |
| path: ~/.npm | |
| key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.OS }}-node- | |
| ${{ runner.OS }}- | |
| - name: Install dependencies โฌ | |
| run: npm ci | |
| - name: Test code โ | |
| run: npm run test | |
| env: | |
| CI: true | |
| - name: Get shogun-gis-client version ๐ | |
| run: | | |
| echo "sonar.projectVersion=$(git describe --tags --abbrev=0 | sed 's/^v//')" >> ./sonar-project.properties | |
| - name: SonarQube Scan ๐ฌ | |
| uses: SonarSource/sonarqube-scan-action@22918119ff8e1ca75a623e15c8296b6ea4fbe28f # v8.2.1 | |
| with: | |
| projectBaseDir: . | |
| env: | |
| SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }} | |
| SONAR_HOST_URL: ${{ secrets.SONARQUBE_HOST }} |