Merge pull request #1750 from terrestris/fix-broken-image #1542
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: Update gh-pages (latest) | |
env: | |
DOCKER_REGISTRY: docker-public.terrestris.de/terrestris | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources ๐ฐ | |
uses: actions/checkout@v4 | |
- name: Setup Node.js ๐งฎ | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Cache Node.js modules ๐พ | |
uses: actions/cache@v4 | |
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/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
branch: gh-pages | |
folder: build | |
target-folder: latest | |
- name: Login to Nexus โจ๏ธ | |
uses: docker/login-action@v3 | |
with: | |
registry: ${{ env.DOCKER_REGISTRY }} | |
username: ${{ secrets.NEXUS_USERNAME }} | |
password: ${{ secrets.NEXUS_PASSWORD }} | |
- name: Build docker image (main) ๐๏ธ | |
uses: docker/build-push-action@v6 | |
with: | |
context: . | |
tags: | | |
${{ env.DOCKER_REGISTRY }}/shogun-gis-client:main | |
load: true | |
- name: Push docker image to Nexus (main) ๐ | |
run: | | |
docker push ${{ env.DOCKER_REGISTRY }}/shogun-gis-client:main | |
- name: Build docker image e2e-tests (main) ๐๏ธ | |
uses: docker/build-push-action@v6 | |
with: | |
file: Dockerfile.e2e | |
context: . | |
tags: | | |
${{ env.DOCKER_REGISTRY }}/shogun-gis-client-e2e-tests:main | |
load: true | |
- name: Push docker image to Nexus (main) ๐ | |
run: | | |
docker push ${{ env.DOCKER_REGISTRY }}/shogun-gis-client-e2e-tests:main | |
sonarqube: | |
if: ${{ github.actor != 'dependabot[bot]' }} | |
name: SonarQube Trigger | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout sources ๐ฐ | |
uses: actions/checkout@v4 | |
with: | |
# Disabling shallow clone is recommended for improving relevancy of reporting | |
fetch-depth: 0 | |
- name: Setup Node.js ๐งฎ | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Cache Node.js modules ๐พ | |
uses: actions/cache@v4 | |
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=$(node -pe "require('./package.json').version")" >> ./sonar-project.properties | |
- name: SonarQube Scan ๐ฌ | |
uses: SonarSource/[email protected] | |
with: | |
projectBaseDir: . | |
env: | |
SONAR_TOKEN: ${{ secrets.SONARQUBE_TOKEN }} | |
SONAR_HOST_URL: ${{ secrets.SONARQUBE_HOST }} |