Try setting environment variable

This commit is contained in:
Alex Hyett 2023-07-10 12:40:37 +01:00
parent 289f9ca08e
commit 9fefe30f64
2 changed files with 7 additions and 4 deletions

View file

@ -7,13 +7,14 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3
- name: Install GitVersion - name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0 uses: gittools/actions/gitversion/setup@v0.9.7
with: with:
versionSpec: '5.x' versionSpec: '5.x'
- uses: actions/checkout@v3
- name: Determine Version - name: Determine Version
uses: gittools/actions/gitversion/execute@v0 id: gitversion
uses: gittools/actions/gitversion/execute@v0.9.7
- name: Semver - name: Semver
run: echo $GITVERSION_SEMVER run: echo $GITVERSION_SEMVER
- name: Setup dotnet - name: Setup dotnet
@ -31,6 +32,8 @@ jobs:
shell: bash shell: bash
- name: Start containers - name: Start containers
run: docker-compose -f "docker-compose.yml" up -d --build run: docker-compose -f "docker-compose.yml" up -d --build
env:
VERSION: ${{ steps.gitversion.outputs.nuGetVersion }}
- name: Wait for docker containers to setup - name: Wait for docker containers to setup
run: sleep 30s run: sleep 30s
shell: bash shell: bash

View file

@ -18,7 +18,7 @@ services:
- ./db/init.sql:/docker-entrypoint-initdb.d/init.sql - ./db/init.sql:/docker-entrypoint-initdb.d/init.sql
api: api:
image: GitHubActionsDemo.Api:${GITVERSION_SEMVER} image: githubactionsdemo.api:${VERSION}
build: . build: .
restart: always restart: always
depends_on: depends_on: