From 88d82320264bda58641d7d39807d3428330cd325 Mon Sep 17 00:00:00 2001 From: Shirou-kun Date: Sun, 10 Nov 2024 19:13:52 +0900 Subject: [PATCH] fx: workflow --- .../workflows/build-push-gcloud.yaml | 1 + .github/workflows/cd-build.yaml | 44 +++++++------------ 2 files changed, 17 insertions(+), 28 deletions(-) rename actions/build-push-gcloud/action.yaml => .github/workflows/build-push-gcloud.yaml (98%) diff --git a/actions/build-push-gcloud/action.yaml b/.github/workflows/build-push-gcloud.yaml similarity index 98% rename from actions/build-push-gcloud/action.yaml rename to .github/workflows/build-push-gcloud.yaml index 02318926..34a5e6dd 100644 --- a/actions/build-push-gcloud/action.yaml +++ b/.github/workflows/build-push-gcloud.yaml @@ -43,6 +43,7 @@ jobs: description: "Image tag" value: ${{ steps.vars.outputs.branch }}-${{ steps.vars.outputs.sha_short }} steps: + - uses: actions/checkout@v4 - name: Docker login to Google Cloud id: vars run: | diff --git a/.github/workflows/cd-build.yaml b/.github/workflows/cd-build.yaml index 01593128..f343427e 100644 --- a/.github/workflows/cd-build.yaml +++ b/.github/workflows/cd-build.yaml @@ -10,33 +10,21 @@ on: jobs: push-backend: name: Build backend - runs-on: ubuntu-latest - outputs: - version: ${{ steps.build.outputs.tag }} - steps: - - uses: actions/checkout@v4 - - uses: ./actions/build-push-gcloud - id: build - with: - google_key: ${{ secrets.GCLOUD_SECRET_KEY }} - repo: services/whisper-notes-backend - dockerfile: backend.Dockerfile - registry: europe-north1-docker.pkg.dev - project_id: ${{ secrets.GCLOUD_PROJECT }} - secrets: inherit + uses: ./.github/workflows/build-push-gcloud.yaml + with: + google_key: ${{ secrets.GCLOUD_SECRET_KEY }} + repo: services/whisper-notes-backend + dockerfile: backend.Dockerfile + registry: europe-north1-docker.pkg.dev + project_id: ${{ secrets.GCLOUD_PROJECT }} + secrets: inherit push-frontend: name: Build frontend - runs-on: ubuntu-latest - outputs: - version: ${{ steps.build.outputs.tag }} - steps: - - uses: actions/checkout@v4 - - uses: ./actions/build-push-gcloud - id: build - with: - google_key: ${{ secrets.GCLOUD_SECRET_KEY }} - repo: services/whisper-notes-frontend - dockerfile: frontend.Dockerfile - registry: europe-north1-docker.pkg.dev - project_id: ${{ secrets.GCLOUD_PROJECT }} - secrets: inherit + uses: ./.github/workflows/build-push-gcloud.yaml + with: + google_key: ${{ secrets.GCLOUD_SECRET_KEY }} + repo: services/whisper-notes-frontend + dockerfile: frontend.Dockerfile + registry: europe-north1-docker.pkg.dev + project_id: ${{ secrets.GCLOUD_PROJECT }} + secrets: inherit