Merge pull request #31 from navikt/dependabot/bundler/geocoder-1.8.2 #87
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 | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
build-push: | |
name: Build and push image | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- run: echo "IMAGE=ghcr.io/${GITHUB_REPOSITORY}:$(git log -1 --pretty=%ad --date=format:%Y-%m-%d)-$(git log --pretty=format:'%h' -n 1)" >> $GITHUB_ENV | |
- run: docker build -t $IMAGE . | |
- uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- uses: docker/build-push-action@v4 | |
with: | |
push: true | |
tags: ${{ env.IMAGE }} | |
context: . | |
nais-yaml: | |
name: Release to nais-yaml | |
runs-on: ubuntu-latest | |
needs: build-push | |
steps: | |
- uses: actions/checkout@v3 | |
- run: echo "TAG=$(git log -1 --pretty=%ad --date=format:%Y-%m-%d)-$(git log --pretty=format:'%h' -n 1)" >> $GITHUB_ENV | |
- name: deploy to prod | |
uses: nais/deploy/actions/deploy@v1 | |
env: | |
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }} | |
CLUSTER: prod-gcp | |
RESOURCE: nais/nais.yaml,nais/alert.yaml | |
VAR: TAG=${{ env.TAG }} |