From bf6aabb1c596318066692d4919f826f4140a2d39 Mon Sep 17 00:00:00 2001 From: wancat Date: Sat, 18 Nov 2023 18:37:29 +0800 Subject: [PATCH] fix: passing docker hub secrets to build workflow --- .github/workflows/build-docker-image.yml | 6 ++++++ .github/workflows/build.yml | 4 ++++ .github/workflows/production.yml | 1 + .github/workflows/pull-request.yml | 3 ++- .github/workflows/staging.yml | 3 ++- 5 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml index 8ad8529..8b0716c 100644 --- a/.github/workflows/build-docker-image.yml +++ b/.github/workflows/build-docker-image.yml @@ -16,6 +16,12 @@ on: required: false description: 'Target to build' + secrets: + DOCKERHUB_USERNAME: + required: true + DOCKERHUB_TOKEN: + required: true + jobs: build-and-push: runs-on: ubuntu-latest diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a95029d..222368f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,6 +10,7 @@ jobs: imageName: 'linuxodyssey/backend' dockerfilePath: './server/Dockerfile' target: prod + secrets: inherit build-frontend: uses: ./.github/workflows/build-docker-image.yml @@ -17,6 +18,7 @@ jobs: imageName: 'linuxodyssey/frontend' dockerfilePath: './app/Dockerfile' target: prod + secrets: inherit build-analytics: uses: ./.github/workflows/build-docker-image.yml @@ -24,9 +26,11 @@ jobs: imageName: 'linuxodyssey/analytics' dockerfilePath: './packages/analytics/Dockerfile' target: prod + secrets: inherit build-base: uses: ./.github/workflows/build-docker-image.yml with: imageName: 'linuxodyssey/base' dockerfilePath: './quests/Dockerfile' + secrets: inherit diff --git a/.github/workflows/production.yml b/.github/workflows/production.yml index e82c2f0..6db9897 100644 --- a/.github/workflows/production.yml +++ b/.github/workflows/production.yml @@ -12,6 +12,7 @@ jobs: build: needs: ci-checks uses: ./.github/workflows/build.yml + secrets: inherit deploy: needs: build diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 4ac6f97..e93272f 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -24,5 +24,6 @@ jobs: GITHUB_TOKEN: ${{ github.token }} build: - uses: ./.github/workflows/build.yml needs: ci-checks + uses: ./.github/workflows/build.yml + secrets: inherit diff --git a/.github/workflows/staging.yml b/.github/workflows/staging.yml index 085090a..48e761c 100644 --- a/.github/workflows/staging.yml +++ b/.github/workflows/staging.yml @@ -10,8 +10,9 @@ jobs: uses: ./.github/workflows/ci-checks.yml build: - uses: ./.github/workflows/build.yml needs: ci-checks + uses: ./.github/workflows/build.yml + secrets: inherit deploy: needs: build