Skip to content

fix wmts hard coded extent #2607

fix wmts hard coded extent

fix wmts hard coded extent #2607

Workflow file for this run

name: CI
on:
# Open any PR -> run tests
pull_request:
types: [opened, synchronize, reopened]
# Push to main branch -> run tests, build & deploy to test
push:
branches: [main]
# Release -> run tests, build & deploy to production
release:
types: [released]
env:
NODE_VERSION: 18.20.4
IMAGE_NAME: ${{ secrets.REGISTRY_ADDRESS }}/hanna
APP_VERSION: ${{ github.event_name == 'release' && github.event.release.name || format('build {0}', github.sha) }}
VITE_FEATURE_SAP_REPORTS: 'true'
jobs:
test-frontend:
name: Test frontend
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
cache-dependency-path: ./frontend/package-lock.json
- name: Install shared dependencies
working-directory: shared
run: npm i
# Install backend dependencies to make tRPC types work
- name: Install backend dependencies
working-directory: backend
run: npm i
- name: Build & test
working-directory: frontend
run: npm i && npm test && npm run build
test-backend:
name: Test backend
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
cache-dependency-path: ./backend/package-lock.json
- name: Install shared dependencies
working-directory: shared
run: npm i
- name: Build & test
working-directory: backend
run: npm i && npm test && npm run build
test-shared:
runs-on: ubuntu-latest
name: Test shared
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'npm'
cache-dependency-path: ./shared/package-lock.json
- name: Build & test
working-directory: shared
run: npm i && npm test && npm run build
test-e2e:
name: Test E2E
runs-on: ubuntu-latest
defaults:
run:
working-directory: e2e
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
cache-dependency-path: ./e2e/package-lock.json
- run: npm i
- name: Get installed Playwright version
id: playwright-version
run: echo "version=$(npm ls @playwright/test --json | jq --raw-output '.dependencies["@playwright/test"].version')" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
id: playwright-cache
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.version }}
restore-keys: |
${{ runner.os }}-playwright-
# Install Playwright dependencies unless found from the cache
- name: Install Playwright's dependencies
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: npx playwright install --with-deps
# Start up the stack & wait for all services to be healthy
- run: CI=1 docker compose -f docker-compose.yml -f docker-compose.ci.yml up -d --wait
timeout-minutes: 10
# Output container logs if any of the previous steps failed
- run: docker compose logs
if: failure()
# Execute the E2E tests
- run: npm test -- --workers=1
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to registry
uses: docker/login-action@v3
with:
registry: ${{ secrets.REGISTRY_ADDRESS }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
# Push only with 'latest' tag for caching
- name: Build
uses: docker/build-push-action@v6
with:
push: true
build-args: |
"APP_VERSION=${{ env.APP_VERSION }}"
tags: ${{ env.IMAGE_NAME }}:latest
cache-from: type=registry,ref=${{ env.IMAGE_NAME }}:latest
cache-to: type=inline
push:
name: Push
# Run push only on pushes to main & when publishing a release
if: ${{ github.event_name == 'push' || github.event_name == 'release' }}
runs-on: ubuntu-latest
needs: [test-frontend, test-backend, test-shared, test-e2e, build]
env:
ENV_NAME: ${{ github.event_name == 'release' && 'production' || 'test' }}
APP_URL: ${{ github.event_name == 'release' && 'https://hanna.tampere.fi' || 'https://tre-hanna-test.azurewebsites.net' }}
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to registry
uses: docker/login-action@v3
with:
registry: ${{ secrets.REGISTRY_ADDRESS }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
# Rebuild the image using the "latest" tag as cache
- name: Build and push
uses: docker/build-push-action@v6
with:
push: true
build-args: |
"EXTRA_HOSTS=${{ secrets.IMAGE_EXTRA_HOSTS }}"
"APP_VERSION=${{ env.APP_VERSION }}"
"VITE_FEATURE_SAP_REPORTS=${{ env.VITE_FEATURE_SAP_REPORTS }}"
tags: ${{ env.IMAGE_NAME }}:${{ env.ENV_NAME }}
cache-from: type=registry,ref=${{ env.IMAGE_NAME }}:latest
cache-to: type=inline
# "Export" some environment variables for the deploy job
outputs:
env_name: ${{ env.ENV_NAME }}
app_url: ${{ env.APP_URL }}
deploy:
name: Deploy
needs: push
runs-on: ubuntu-latest
environment:
name: ${{ needs.push.outputs.env_name }}
url: ${{ needs.push.outputs.app_url }}
steps:
- name: Deploy
run: curl --fail -X POST '${{ secrets.DEPLOY_WEBHOOK_URL }}'