Build and Deploy (dev) #189
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 and Deploy (dev) | |
on: | |
workflow_dispatch: | |
env: | |
IMAGE: ghcr.io/navikt/familie-dokument:${{ github.sha }} | |
jobs: | |
build-and-deploy-to-dev: | |
name: Build, push til docker og deploy til GCP (dev) | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
persist-credentials: false | |
- 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 --file pom.xml | |
- name: Bygg Docker image | |
run: | | |
docker build -t ${IMAGE} . | |
- name: Login to Github Package Registry | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
echo ${GITHUB_TOKEN} | docker login ghcr.io --username ${GITHUB_REPOSITORY} --password-stdin | |
- name: Push Docker image med versjonstag | |
run: docker push ${IMAGE} | |
- name: Deploy til GCP (dev) | |
uses: nais/deploy/actions/deploy@v1 | |
env: | |
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }} | |
CLUSTER: dev-gcp | |
RESOURCE: .deploy/nais-dev.yaml |