Skip to content

Commit

Permalink
Shorten the 'fetch-vars' jobs. (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
Zifah authored Aug 7, 2024
1 parent 3170630 commit 6d08464
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 18 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/api-deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,8 @@ jobs:
runs-on: ubuntu-latest
environment: staging
outputs:
api_service_name: ${{ vars.API_SERVICE_NAME }}
api_service_path: ${{ vars.API_SERVICE_PATH }}
steps:
- run: |
echo "Exposing ENV vars to reusable workflows."
service_name: ${{ vars.API_SERVICE_NAME }}
service_path: ${{ vars.API_SERVICE_PATH }}

deploy:
needs: fetch-vars
Expand All @@ -23,5 +20,6 @@ jobs:
with:
project-name: Api
dotnet-version: '6.0.x'
service-name: ${{ needs.fetch-vars.outputs.api_service_name }}
service-path: ${{ needs.fetch-vars.outputs.api_service_path }}
service-name: ${{ needs.fetch-vars.outputs.service_name }}
service-path: ${{ needs.fetch-vars.outputs.service_path }}
environment: staging
5 changes: 4 additions & 1 deletion .github/workflows/deploy-dotnet-service-ec2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,15 @@ on:
service-path:
required: true
type: string
environment:
required: true
type: string

jobs:
deploy:
if: github.repository_owner == 'Yorubaname'
runs-on: ubuntu-latest
environment: staging
environment: ${{ inputs.environment }}

steps:
- name: Checkout code
Expand Down
15 changes: 5 additions & 10 deletions .github/workflows/website-deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,8 @@ jobs:
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: Set Environment Variables
id: set-vars
run: |
echo "website_service_name=${{ vars.WEBSITE_SERVICE_NAME }}" >> $GITHUB_OUTPUT
echo "website_service_path=${{ vars.WEBSITE_SERVICE_PATH }}" >> $GITHUB_OUTPUT
service_name: ${{ vars.WEBSITE_SERVICE_NAME }}
service_path: ${{ vars.WEBSITE_SERVICE_PATH }}

deploy:
needs: fetch-vars
Expand All @@ -26,5 +20,6 @@ jobs:
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 }}
service-name: ${{ needs.fetch-vars.outputs.service_name }}
service-path: ${{ needs.fetch-vars.outputs.service_path }}
environment: staging

0 comments on commit 6d08464

Please sign in to comment.