Skip to content

Bump the all-dependencies group with 12 updates (#1247) #696

Bump the all-dependencies group with 12 updates (#1247)

Bump the all-dependencies group with 12 updates (#1247) #696

name: Build-Deploy-Prod
on:
push:
branches:
- 'main'
env:
IMAGE: ghcr.io/navikt/familie-tilbake:${{ github.sha }}
IMAGE_LATEST: ghcr.io/navikt/familie-tilbake:latest
jobs:
build:
name: Bygg app/image, push til github, deploy til prod-gcp og dev-gcp
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'temurin'
cache: 'maven'
- name: Bygg med maven
env:
GITHUB_USERNAME: x-access-token
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: mvn -B --no-transfer-progress package --settings .m2/maven-settings.xml -DtrimStackTrace=false --file pom.xml -Dchangelist= -Dsha1=-$TIMESTAMP-$(echo $GITHUB_SHA | cut -c1-7)
- name: Bygg Docker image
run: |
docker build -t ${IMAGE} -t ${IMAGE_LATEST} .
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push Docker image med versjonstag
run: docker push ${IMAGE}
- name: Push Docker image med 'latest' tag
run: docker push ${IMAGE_LATEST}
- name: Post build failures to Slack
if: failure()
run: |
curl -X POST --data "{\"text\": \"Build av $GITHUB_REPOSITORY feilet - $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID\"}" $WEBHOOK_URL
env:
WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
deploy:
name: Deploy to GCP
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Deploy til dev-gcp
uses: nais/deploy/actions/deploy@v1
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: dev-gcp
RESOURCE: .deploy/nais/app-dev-gcp.yaml
- name: Deploy til prod-gcp
uses: nais/deploy/actions/deploy@v1
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: prod-gcp
RESOURCE: .deploy/nais/app-prod-gcp.yaml
- name: Deploy dvh_sak_topic
uses: nais/deploy/actions/deploy@v1
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: prod-gcp
RESOURCE: .deploy/nais/kafka/prod/dvh_sak_topic_prod.yaml
- name: Deploy dvh_vedtak_topic
uses: nais/deploy/actions/deploy@v1
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: prod-gcp
RESOURCE: .deploy/nais/kafka/prod/dvh_vedtak_topic_prod.yaml
- name: Deploy hentfagsystemsbehandling_request_topic
uses: nais/deploy/actions/deploy@v1
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: prod-gcp
RESOURCE: .deploy/nais/kafka/prod/hentfagsystemsbehandling_request_topic_prod.yaml
- name: Deploy hentfagsystemsbehandling_respons_topic
uses: nais/deploy/actions/deploy@v1
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: prod-gcp
RESOURCE: .deploy/nais/kafka/prod/hentfagsystemsbehandling_respons_topic_prod.yaml
- name: Post deploy failures to Slack
if: failure()
run: |
curl -X POST --data "{\"text\": \"Deploy av $GITHUB_REPOSITORY feilet - $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID\"}" $WEBHOOK_URL
env:
MESSAGE: "Deploy av feilet"
WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}