Tb 52 Legg til action dependency review #105
Workflow file for this run
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: Build, test and deploy | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
workflow_dispatch: | |
permissions: | |
contents: write | |
packages: write | |
env: | |
registry: ghcr.io | |
image_name: ${{ github.repository }} | |
jobs: | |
build: | |
name: Build, test and push | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout project sources | |
uses: actions/checkout@v4 | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'temurin' | |
java-version: '21' | |
- name: Run build and integration tests | |
run: ./gradlew build integrationTest | |
- name: Build and push docker | |
id: docker | |
if: github.event_name == 'push' && github.ref_name == 'main' | |
uses: ./.github/actions/build-push-docker | |
outputs: | |
image_name: ${{ steps.docker.outputs.image_name }} | |
image_tag: ${{ steps.docker.outputs.image_tag }} | |
image_digest: ${{ steps.docker.outputs.image_digest }} | |
deploy: | |
needs: [ build ] | |
name: Deploy to dev | |
uses: kartverket/bygning-github-workflows/.github/workflows/update-app-version.yaml@main | |
if: github.event_name == 'push' && github.ref_name == 'main' | |
permissions: | |
id-token: write | |
with: | |
application_name: bygning-backend | |
image_name: ${{ needs.build.outputs.image_name }} | |
image_tag: ${{ needs.build.outputs.image_tag }} | |
image_digest: ${{ needs.build.outputs.image_digest }} | |
env: dev | |
namespace: matrikkelbygning-main | |
cluster: atgcp1 | |
run-pharos: | |
needs: [ build ] | |
name: Run Pharos | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' && github.ref_name == 'main' | |
permissions: | |
actions: read | |
packages: read | |
contents: read | |
security-events: write | |
steps: | |
- name: "Run Pharos" | |
uses: kartverket/pharos@v0.2.1 | |
with: | |
image_url: ${{ needs.build.outputs.image_name }}@${{ needs.build.outputs.image_digest }} |