Skip to content

Unify the logging config so that JSON logging works #312

Unify the logging config so that JSON logging works

Unify the logging config so that JSON logging works #312

name: Integration test
on:
pull_request:
paths:
- "src/datadoc/**"
- "poetry.lock"
- ".nais/test-pr.yaml"
- ".github/workflows/integration-test.yml"
- "gunicorn.conf.py"
env:
REGISTRY: europe-north1-docker.pkg.dev/nais-management-b3a7/dapla-metadata
IMAGE: datadoc
TAG: ${{ github.head_ref }}-${{ github.sha }}
jobs:
docker-build:
name: Docker build
permissions:
contents: "read"
id-token: "write"
runs-on: ubuntu-latest
outputs:
image-tag: ${{ steps.metadata.outputs.tags }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: "Authenticate to Google Cloud"
id: "auth"
uses: "google-github-actions/[email protected]"
with:
workload_identity_provider: "projects/906675412832/locations/global/workloadIdentityPools/ssb-identity-pool/providers/github-oidc-provider"
service_account: "[email protected]"
token_format: "access_token"
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Login to registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: "oauth2accesstoken"
password: "${{ steps.auth.outputs.access_token }}"
- name: Docker meta
id: metadata
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE }}
# Docker tags based on the following events/attributes
tags: |
type=sha
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64,linux/arm64
file: Dockerfile
push: true
tags: |
${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
- name: Output image digest
run: echo ${{ steps.docker_build.outputs.digest }}
deploy:
name: Deploy to NAIS
runs-on: ubuntu-latest
needs: docker-build
permissions:
contents: "read"
id-token: "write"
steps:
- uses: actions/checkout@v4
- uses: nais/deploy/actions/deploy@v2
env:
CLUSTER: test
RESOURCE: .nais/test-pr.yaml
VAR: image=${{ needs.docker-build.outputs.image-tag }},pr-number=${{github.event.number}}
DEPLOY_SERVER: deploy.ssb.cloud.nais.io:443
mabl-test:
name: Run mabl tests
runs-on: ubuntu-latest
needs: deploy
steps:
- name: Run mabl tests
id: mabl-test-deployment
uses: mablhq/[email protected]
env:
# Use a "CI/CD Integration" type of mabl API key
MABL_API_KEY: ${{ secrets.MABL_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
application-id: ${{ secrets.DATADOC_MABL_APPLICATION_ID }}
environment-id: ${{ secrets.DATADOC_MABL_ENVIRONMENT_ID }}
uri: https://datadoc-pr-${{github.event.number}}.test.ssb.no
mabl-branch: ${{ github.head_ref }}
plan-labels: Datadoc