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"