From 8b0b228a7947fb91447d3a6bfce158f2998f49a6 Mon Sep 17 00:00:00 2001 From: esaminu Date: Wed, 4 Oct 2023 23:05:44 +0400 Subject: [PATCH] feat: add push to gcr action --- .github/workflows/deploy-main.yml | 8 ++++++++ .github/workflows/push-to-gcr.yml | 27 +++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 .github/workflows/push-to-gcr.yml diff --git a/.github/workflows/deploy-main.yml b/.github/workflows/deploy-main.yml index 2573ff0d..e4948519 100644 --- a/.github/workflows/deploy-main.yml +++ b/.github/workflows/deploy-main.yml @@ -5,6 +5,10 @@ on: branches: - main +permissions: + id-token: write + contents: read + concurrency: group: 'fast-auth-signer-deployment' cancel-in-progress: true @@ -27,3 +31,7 @@ jobs: with: environment: mainnet secrets: inherit + + deploy-docker-image-to-gcr: + uses: ./.github/workflows/push-to-gcr.yml + secrets: inherit \ No newline at end of file diff --git a/.github/workflows/push-to-gcr.yml b/.github/workflows/push-to-gcr.yml new file mode 100644 index 00000000..05868102 --- /dev/null +++ b/.github/workflows/push-to-gcr.yml @@ -0,0 +1,27 @@ +name: Push to GCR GitHub Action + +on: + workflow_call: + +permissions: + id-token: write + contents: read + +jobs: + build-and-push-to-gcr: + runs-on: ubuntu-latest + permissions: + contents: 'read' + id-token: 'write' + steps: + - uses: actions/checkout@v3 + - uses: google-github-actions/setup-gcloud@v1 + - uses: google-github-actions/auth@v1 + with: + credentials_json: ${{ secrets.SERVICE_ACCOUNT_KEY_JSON }} + - uses: RafikFarhad/push-to-gcr-github-action@v5-beta + with: + registry: gcr.io + project_id: fast-auth-sdk + image_name: frontend + image_tag: latest \ No newline at end of file