diff --git a/.github/workflows/queue_and_merge.yml b/.github/workflows/queue_and_merge.yml index d01c87924..437d48363 100644 --- a/.github/workflows/queue_and_merge.yml +++ b/.github/workflows/queue_and_merge.yml @@ -3,6 +3,8 @@ name: Check Stuff 👨‍🔧 on: merge_group: pull_request: + branches: + - main push: branches: - main @@ -100,27 +102,10 @@ jobs: cache: true - run: just fmt - build: - if: ${{ github.event_name == 'pull_request' }} - name: Build - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: taiki-e/install-action@just - - uses: rui314/setup-mold@v1 - - uses: heliaxdev/setup-protoc@v2 - with: - version: "25.0" - repo-token: ${{ secrets.GITHUB_TOKEN }} - - uses: actions-rust-lang/setup-rust-toolchain@v1 - with: - cache: true - - run: just build - docker: name: Docker runs-on: ubuntu-latest - if: ${{ github.event_name == 'merge_group' || github.ref == 'refs/heads/main' }} + if: ${{ github.event_name == 'merge_group' || github.event_name == 'pull_request' }} env: GIT_LFS_SKIP_SMUDGE: 1 REGISTRY_URL: ghcr.io @@ -145,6 +130,18 @@ jobs: uses: actions/checkout@v4 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY_URL }}/anoma/namada-indexer + flavor: | + latest=auto + prefix=${{ matrix.docker.image }} + suffix= + tags: | + type=ref,event=branch,prefix=${{ matrix.docker.image }}-branch- + type=ref,event=pr,prefix=${{ matrix.docker.image }}-pr- - name: Login to GHCR uses: docker/login-action@v3 with: @@ -157,15 +154,15 @@ jobs: with: context: . file: Dockerfile - build-args: PACKAGE=${{matrix.docker.package}} - push: ${{ github.ref == 'refs/heads/main' }} - tags: ${{ env.REGISTRY_URL }}/anoma/namada-indexer:${{ matrix.docker.image }}-main + build-args: PACKAGE=${{ matrix.docker.package }} + push: true + tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha cache-to: type=gha,mode=max can_enqueue: - needs: [clippy, format, build, validate-swagger] + needs: [clippy, format, docker, validate-swagger] if: always() && github.event_name != 'merge_group' permissions: actions: read