Skip to content

Commit

Permalink
workflow for branchen
Browse files Browse the repository at this point in the history
  • Loading branch information
davidsteinsland committed Dec 14, 2023
1 parent 8e8b0ea commit 3ebd7c2
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/uuid_hele_vegen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: master

on:
push:
branches:
- uuid_hele_vegen

jobs:
set_version:
name: set image name
runs-on: ubuntu-latest
steps:
- name: create docker tag
run: echo "TAG=$(echo ${{ github.sha }} | cut -c1-7)" >> $GITHUB_ENV
outputs:
image: ghcr.io/${{ github.repository }}/spanner:uuid_hele_vegen-${{ env.TAG }}


build:
name: build docker image
runs-on: ubuntu-latest
needs: set_version
permissions:
packages: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17.x'
- uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: test and build
run: ./gradlew build
- name: build docker image
run: docker build . --pull -t ${{ needs.set_version.outputs.image }}
- name: push docker image
run: |
docker login --username "$GITHUB_REPOSITORY" -p ${{ secrets.GITHUB_TOKEN }} ghcr.io
docker push ${{ needs.set_version.outputs.image }}
deployDev:
name: Deploy to dev
needs: [ set_version, build ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: nais/deploy/actions/deploy@v1
env:
APIKEY: ${{ secrets.NAIS_DEPLOY_APIKEY }}
CLUSTER: dev-gcp
RESOURCE: deploy/dev.yml
IMAGE: ${{ needs.set_version.outputs.image }}

0 comments on commit 3ebd7c2

Please sign in to comment.