diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 2d59827..e4c75ae 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -7,13 +7,14 @@ jobs: runs-on: ubuntu-latest steps: + - uses: actions/checkout@v3 - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v0 + uses: gittools/actions/gitversion/setup@v0.9.7 with: versionSpec: '5.x' - - uses: actions/checkout@v3 - name: Determine Version - uses: gittools/actions/gitversion/execute@v0 + id: gitversion + uses: gittools/actions/gitversion/execute@v0.9.7 - name: Semver run: echo $GITVERSION_SEMVER - name: Setup dotnet @@ -31,6 +32,8 @@ jobs: shell: bash - name: Start containers run: docker-compose -f "docker-compose.yml" up -d --build + env: + VERSION: ${{ steps.gitversion.outputs.nuGetVersion }} - name: Wait for docker containers to setup run: sleep 30s shell: bash diff --git a/docker-compose.yml b/docker-compose.yml index 949b36d..def549b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -18,7 +18,7 @@ services: - ./db/init.sql:/docker-entrypoint-initdb.d/init.sql api: - image: GitHubActionsDemo.Api:${GITVERSION_SEMVER} + image: githubactionsdemo.api:${VERSION} build: . restart: always depends_on: