diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index e792139..22bf7a5 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -48,6 +48,7 @@ jobs: if: github.ref == 'refs/heads/main' - name: Push docker + id: push_docker run: pnpm docker:push if: github.ref == 'refs/heads/main' @@ -58,6 +59,5 @@ jobs: app-name: "Minigolffreitag" slot-name: "production" publish-profile: ${{ secrets.AzureAppService_PublishProfile_4d5a9096408d4948a5453808899f123a }} - images: "masch0212/minigolf-friday:latest" - restart: true + images: "masch0212/minigolf-friday:${{ steps.push_docker.outputs.docker_tag }}" if: github.ref == 'refs/heads/main' diff --git a/scripts/docker-push.js b/scripts/docker-push.js index b1d6920..6ab56a0 100644 --- a/scripts/docker-push.js +++ b/scripts/docker-push.js @@ -1,5 +1,6 @@ import { spawnSync } from "child_process"; import { repository, imageName, repoRootDir, getVersionTag } from "./docker-vars.js"; +import { appendFileSync } from "fs"; const tag = getVersionTag(); spawnSync( @@ -15,3 +16,5 @@ spawnSync("docker", ["push", `${repository}/${imageName}:latest`], { cwd: repoRootDir, stdio: "inherit", }); + +appendFileSync(process.env.GITHUB_OUTPUT, `docker_tag=${tag}\n`);