delete old index - start new #5
Workflow file for this run
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: Klass search | |
| on: | |
| push: | |
| paths: | |
| - "klass-api/**" | |
| - "klass-shared/**" | |
| - ".nais/**/klass-api-search.yaml" | |
| - ".github/workflows/klass-search.yaml" | |
| jobs: | |
| build: | |
| name: Build | |
| permissions: | |
| contents: "read" | |
| id-token: "write" | |
| packages: "read" | |
| runs-on: ubuntu-latest | |
| outputs: | |
| image: ${{ steps.docker-build-push.outputs.image }} | |
| telemetry: ${{ steps.docker-build-push.outputs.telemetry }} | |
| test-config-changed: ${{ steps.test-config-changed.outputs.changed != 'non-inputs' }} | |
| only-config-changed: ${{ steps.changed-files.outputs.changed == 'only-inputs'}} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| cache: 'maven' | |
| - name: Check what changed | |
| id: changed-files | |
| uses: "nais/what-changed@main" | |
| with: | |
| files: .nais/**/klass-api-search.yaml | |
| - name: Check for test config changes | |
| id: test-config-changed | |
| uses: "nais/what-changed@main" | |
| with: | |
| files: .nais/test/klass-api-search.yaml | |
| - name: Build with Maven | |
| if: steps.changed-files.outputs.changed != 'only-inputs' || github.event.inputs.cluster == 'test' | |
| run: mvn --batch-mode --update-snapshots install | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push | |
| if: steps.changed-files.outputs.changed != 'only-inputs' || github.event.inputs.cluster == 'test' | |
| uses: nais/docker-build-push@v0 | |
| id: docker-build-push | |
| with: | |
| team: dapla-metadata | |
| image_suffix: api | |
| dockerfile: klass-api/Dockerfile | |
| docker_context: klass-api | |
| deploy-test: | |
| name: Deploy to test | |
| needs: build | |
| permissions: | |
| contents: "read" | |
| id-token: "write" | |
| packages: "read" | |
| runs-on: ubuntu-latest | |
| if: github.event_name != 'release' || github.event.inputs.cluster == 'test' || needs.build.outputs.test-config-changed == 'true' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - uses: nais/deploy/actions/deploy@v2 | |
| env: | |
| CLUSTER: test | |
| RESOURCE: .nais/test/klass-api-search.yaml | |
| DEPLOY_SERVER: deploy.ssb.cloud.nais.io:443 | |
| WORKLOAD_IMAGE: ${{ needs.build.outputs.image }} | |
| TELEMETRY: ${{ needs.build.outputs.telemetry }} | |