From 791b691bbb4bb688ad15bf9ca6a7721cb2eae693 Mon Sep 17 00:00:00 2001 From: Tommy Chen Date: Tue, 2 Apr 2024 17:37:47 +0800 Subject: [PATCH] ci: Run publish job --- .github/workflows/build_and_test.yaml | 78 +++++++++++++-------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/.github/workflows/build_and_test.yaml b/.github/workflows/build_and_test.yaml index 9bf7c89f411..d3f629829e2 100644 --- a/.github/workflows/build_and_test.yaml +++ b/.github/workflows/build_and_test.yaml @@ -131,45 +131,45 @@ jobs: IMAGE_PULL_POLICY: IfNotPresent run: make e2e -# publish: -# runs-on: ubuntu-latest -# needs: [conformance-test, e2e-test] -# steps: -# - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 -# - uses: ./tools/github-actions/setup-deps -# -# - name: Download EG Binaries -# uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 -# with: -# name: envoy-gateway -# path: bin/ -# -# - name: Give Privileges To EG Binaries -# run: | -# chmod +x bin/linux/amd64/envoy-gateway -# chmod +x bin/linux/arm64/envoy-gateway -# -# # build and push image -# - name: Login to DockerHub -# if: github.event_name == 'push' -# uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0 -# with: -# username: ${{ secrets.DOCKERHUB_USERNAME }} -# password: ${{ secrets.DOCKERHUB_PASSWORD }} -# -# - name: Setup Multiarch Environment -# if: github.event_name == 'push' -# run: make image.multiarch.setup -# -# - name: Build and Push EG Commit Image -# if: github.event_name == 'push' -# # tag is set to the short SHA of the commit -# run: make image.push.multiarch PLATFORMS="linux_amd64 linux_arm64" IMAGE=envoyproxy/gateway-dev -# -# - name: Build and Push EG Latest Image -# if: github.event_name == 'push' && github.ref == 'refs/heads/main' -# # tag is set to `latest` when pushing to main branch -# run: make image.push.multiarch TAG=latest PLATFORMS="linux_amd64 linux_arm64" IMAGE=envoyproxy/gateway-dev + publish: + runs-on: ubuntu-latest + needs: [conformance-test, e2e-test] + steps: + - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + - uses: ./tools/github-actions/setup-deps + + - name: Download EG Binaries + uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4 + with: + name: envoy-gateway + path: bin/ + + - name: Give Privileges To EG Binaries + run: | + chmod +x bin/linux/amd64/envoy-gateway + chmod +x bin/linux/arm64/envoy-gateway + + # build and push image + - name: Login to DockerHub + if: github.event_name == 'push' + uses: docker/login-action@e92390c5fb421da1463c202d546fed0ec5c39f20 # v3.1.0 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Setup Multiarch Environment + if: github.event_name == 'push' + run: make image.multiarch.setup + + - name: Build and Push EG Commit Image + if: github.event_name == 'push' + # tag is set to the short SHA of the commit + run: make image.push.multiarch PLATFORMS="linux_amd64 linux_arm64" IMAGE=dcard/envoy-gateway + + - name: Build and Push EG Latest Image + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + # tag is set to `latest` when pushing to main branch + run: make image.push.multiarch TAG=latest PLATFORMS="linux_amd64 linux_arm64" IMAGE=dcard/envoy-gateway # # - name: Build and Push EG Latest Helm Chart # if: github.event_name == 'push' && github.ref == 'refs/heads/main'