From 0aa7191a9b17196df1f515ef2260ee61a21bf8bf Mon Sep 17 00:00:00 2001 From: Gervasio Marchand Date: Thu, 20 Jul 2023 21:40:00 -0300 Subject: [PATCH] Use the new shared action --- .github/workflows/build.yml | 67 ++----------------------------------- 1 file changed, 2 insertions(+), 65 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3b930f5..99fa40e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,68 +4,5 @@ on: branches: [ main ] jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - architecture: [ amd64, arm64v8 ] - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 # get entire git tree, required for nerdbank gitversioning - - 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: | - Push-Location src - $version = (nbgv get-version -f json | ConvertFrom-Json).SimpleVersion - Write-Host "Version $version" - Pop-Location - - if ('${{ matrix.architecture }}' -eq 'arm64v8') { - sudo apt-get install qemu binfmt-support qemu-user-static - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - } - - docker build . -t ghcr.io/g3rv4/fakerelay:latest-${{ matrix.architecture }} --build-arg ARCH=${{ matrix.architecture }} - docker tag ghcr.io/g3rv4/fakerelay:latest-${{ matrix.architecture }} ghcr.io/g3rv4/fakerelay:$version-${{ matrix.architecture }} - docker push ghcr.io/g3rv4/fakerelay:latest-${{ matrix.architecture }} - docker push ghcr.io/g3rv4/fakerelay:$version-${{ matrix.architecture }} - push-manifest: - runs-on: ubuntu-latest - needs: [ build ] - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 # get entire git tree, required for nerdbank gitversioning - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} - - name: Build manifest - shell: pwsh - run: | - Push-Location src - $version = (nbgv get-version -f json | ConvertFrom-Json).SimpleVersion - Write-Host "Version $version" - Pop-Location - - docker manifest create ` - ghcr.io/g3rv4/fakerelay:latest ` - --amend ghcr.io/g3rv4/fakerelay:latest-amd64 ` - --amend ghcr.io/g3rv4/fakerelay:latest-arm64v8 - docker manifest create ` - ghcr.io/g3rv4/fakerelay:$version ` - --amend ghcr.io/g3rv4/fakerelay:$version-amd64 ` - --amend ghcr.io/g3rv4/fakerelay:$version-arm64v8 - docker manifest push ghcr.io/g3rv4/fakerelay:latest - docker manifest push ghcr.io/g3rv4/fakerelay:$version + build-containers: + uses: g3rv4/actions/.github/workflows/dotnet-webapp.yml@v1