From a9579d9f0c61d223dd9a89bf2c4028504fe8ed5a Mon Sep 17 00:00:00 2001 From: Ori Shavit Date: Tue, 9 Apr 2024 15:23:50 +0300 Subject: [PATCH] Release workflow --- .github/workflows/build.yml | 1 + .github/workflows/release.yml | 41 ++++++++++++++++++++++++++++++++++- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7392476..d56951f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,6 +35,7 @@ jobs: password: ${{ secrets.B64_GCLOUD_SERVICE_ACCOUNT_JSON}} - uses: actions/setup-go@v3 + - name: Build release run: make release diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f2a7dd5..8ad6f6b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,4 +16,43 @@ jobs: - name: Checkout uses: actions/checkout@v2 with: - fetch-depth: 1 \ No newline at end of file + fetch-depth: 1 + + - name: Login to GCR + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: _json_key_base64 + password: ${{ secrets.B64_GCLOUD_SERVICE_ACCOUNT_JSON}} + + - name: Login to DockerHub + uses: docker/login-action@v1 + with: + username: otterize + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Set up Docker Buildx + id: buildx + uses: docker/setup-buildx-action@master + with: + driver-opts: network=host + + - uses: actions/setup-go@v3 + + - name: Build release + run: make release + + - uses: actions/upload-artifact@v4 + if: github.event_name == 'push' + with: + name: release + path: build/bin/* + + - name: Build artifacts as Docker image + if: github.event_name == 'push' + uses: docker/build-push-action@v2 + with: + context: . + tags: ${{ env.REGISTRY }}/rolesanywhere-credential-helper:${{ github.ref_name }},otterize/rolesanywhere-credential-helper:${{ github.ref_name }},otterize/rolesanywhere-credential-helper:latest + push: true + platforms: linux/amd64,linux/arm64