From 7413a91bbdc45fc99839398b57f281f993add654 Mon Sep 17 00:00:00 2001 From: Gervasio Marchand Date: Sat, 3 Dec 2022 17:39:05 -0300 Subject: [PATCH] Try to build and push the image --- .github/workflows/build.yml | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6829601..66c79a1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,22 +11,20 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 0 # get entire git tree, required for nerdbank gitversioning - - name: Get version + - name: Login to GitHub Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build and push the Docker image shell: pwsh run: | - cd src + Push-Location src $version = (nbgv get-version -f json | ConvertFrom-Json).SimpleVersion Write-Host "Version $version" - Write-Output "VERSION=$version" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - - # - name: Login to GitHub Container Registry - # uses: docker/login-action@v2 - # with: - # registry: ghcr.io - # username: ${{ github.actor }} - # password: ${{ secrets.GITHUB_TOKEN }} - # - name: Build the hello-docker Docker image - # run: | - # docker build . --tag ghcr.io/g3rv4/fakerelay:latest - # docker run ghcr.io/deselikem/hello-docker-gcr-demo:latest - # docker push ghcr.io/deselikem/hello-docker-gcr-demo:latest \ No newline at end of file + Pop-Location + + docker build . --tag ghcr.io/g3rv4/fakerelay:latest --tag "ghcr.io/g3rv4/fakerelay:$version" + docker push ghcr.io/g3rv4/fakerelay:latest + docker push "ghcr.io/g3rv4/fakerelay:$version"