From 09c9f5e0ad794c7fcaa350da015bbacee1e14d90 Mon Sep 17 00:00:00 2001 From: Hafiz Adewuyi Date: Wed, 7 Aug 2024 14:55:15 +0300 Subject: [PATCH] Attempt to fix empty vars issue. (#81) --- .github/workflows/api-deploy-staging.yml | 18 +++++++++++-- .github/workflows/website-deploy-staging.yml | 27 ++++++++++++++------ 2 files changed, 35 insertions(+), 10 deletions(-) diff --git a/.github/workflows/api-deploy-staging.yml b/.github/workflows/api-deploy-staging.yml index aecbdcf..2353dd9 100644 --- a/.github/workflows/api-deploy-staging.yml +++ b/.github/workflows/api-deploy-staging.yml @@ -6,11 +6,25 @@ on: - main jobs: + fetch-vars: + runs-on: ubuntu-latest + environment: staging + outputs: + api_service_name: ${{ steps.set-vars.outputs.api_service_name }} + api_service_path: ${{ steps.set-vars.outputs.api_service_path }} + steps: + - name: Set Environment Variables + id: set-vars + run: | + echo "::set-output name=api_service_name::${{ vars.API_SERVICE_NAME }}" + echo "::set-output name=api_service_path::${{ vars.API_SERVICE_PATH }}" + deploy: + needs: fetch-vars uses: ./.github/workflows/deploy-dotnet-service-ec2.yml secrets: inherit with: project-name: Api dotnet-version: '6.0.x' - service-name: ${{ vars.API_SERVICE_NAME }} - service-path: ${{ vars.API_SERVICE_PATH }} \ No newline at end of file + service-name: ${{ needs.fetch-vars.outputs.api_service_name }} + service-path: ${{ needs.fetch-vars.outputs.api_service_path }} diff --git a/.github/workflows/website-deploy-staging.yml b/.github/workflows/website-deploy-staging.yml index d14236c..d93ec62 100644 --- a/.github/workflows/website-deploy-staging.yml +++ b/.github/workflows/website-deploy-staging.yml @@ -6,14 +6,25 @@ on: - main jobs: - deploy: + fetch-vars: runs-on: ubuntu-latest environment: staging + outputs: + website_service_name: ${{ steps.set-vars.outputs.website_service_name }} + website_service_path: ${{ steps.set-vars.outputs.website_service_path }} steps: - - name: Call reusable workflow - uses: ./.github/workflows/deploy-dotnet-service-ec2.yml - with: - project-name: Website - dotnet-version: '8.0.x' - service-name: ${{ vars.WEBSITE_SERVICE_NAME }} - service-path: ${{ vars.WEBSITE_SERVICE_PATH }} + - name: Set Environment Variables + id: set-vars + run: | + echo "::set-output name=website_service_name::${{ vars.WEBSITE_SERVICE_NAME }}" + echo "::set-output name=website_service_path::${{ vars.WEBSITE_SERVICE_PATH }}" + + deploy: + needs: fetch-vars + uses: ./.github/workflows/deploy-dotnet-service-ec2.yml + secrets: inherit + with: + project-name: Website + dotnet-version: '8.0.x' + service-name: ${{ needs.fetch-vars.outputs.website_service_name }} + service-path: ${{ needs.fetch-vars.outputs.website_service_path }}