diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 0b41090..2804890 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,14 +1,11 @@ name: Build and Push Docker Image on: - push: - branches: - - main workflow_dispatch: jobs: build-and-push: - if: ${{ github.event.workflow_run.conclusion == 'success' }} + # if: ${{ github.event.workflow_run.conclusion == 'success' }} runs-on: ubuntu-latest steps: @@ -21,16 +18,23 @@ jobs: VERSION=$(grep '^version' Cargo.toml | head -n 1 | awk -F'"' '{print $2}') echo "VERSION=$VERSION" >> $GITHUB_ENV echo "Version extracted: $VERSION" - - - name: Log in to Docker Hub - uses: docker/login-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.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Build image - run: docker build -t docker.io/uhryniuk/tally:${{ env.VERSION }} . + username: ${{ secrets.DOCKER_USERNAME}} + password: ${{ secrets.DOCKER_PASSWORD}} + - + name: Build and push + uses: docker/build-push-action@v6 + with: + push: true + tags: uhryniuk/tally:${{ env.VERSION }} - - name: Push image - run: docker push docker.io/uhryniuk/tally:${{ env.VERSION }} diff --git a/.github/workflows/lint-build-test.yml b/.github/workflows/lint-build-test.yml index 6a58313..f9d95f7 100644 --- a/.github/workflows/lint-build-test.yml +++ b/.github/workflows/lint-build-test.yml @@ -1,8 +1,6 @@ name: Rust lint, build and test -on: - pull_request: - branches: [ "main" ] +on: ["push", "workflow_dispatch"] env: CARGO_TERM_COLOR: always