diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 4a21d4a..1babd05 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -20,18 +20,27 @@ jobs: run: dotnet restore - name: Build run: dotnet build --no-restore - - push_to_registry: + + docker: + runs-on: ubuntu-22.04 needs: [build] name: DockerHub Publish - runs-on: ubuntu-22.04 steps: - - name: Check out the repo - uses: actions/checkout@v3 - - name: Push to Docker Hub - uses: docker/build-push-action@v2 + - + name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - + name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v5 with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - repository: vanderlangs/orion-api - tag_with_ref: true + push: ${{ github.event_name != 'pull_request' }} + tags: vanderlangs/orion-api:latest \ No newline at end of file