Skip to content

Commit

Permalink
Create deployment workflow for website and API to PROD environment. (#87
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Zifah authored Aug 8, 2024
1 parent 6410b6d commit b824103
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/api-deploy-PROD.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Deploy API to EC2 PROD

on:
push:
branches:
- PROD

jobs:
fetch-vars:
if: github.repository_owner == 'Yorubaname'
runs-on: ubuntu-latest
environment: PROD
outputs:
service_name: ${{ vars.API_SERVICE_NAME }}
service_path: ${{ vars.API_SERVICE_PATH }}
steps:
- run: echo "Exposing vars to reusable workflow."

deploy:
if: github.repository_owner == 'Yorubaname'
needs: fetch-vars
uses: ./.github/workflows/deploy-dotnet-service-ec2.yml
secrets: inherit
with:
project-name: Api
dotnet-version: '6.0.x'
service-name: ${{ needs.fetch-vars.outputs.service_name }}
service-path: ${{ needs.fetch-vars.outputs.service_path }}
environment: PROD
29 changes: 29 additions & 0 deletions .github/workflows/website-deploy-PROD.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Deploy Website to EC2 PROD

on:
push:
branches:
- PROD

jobs:
fetch-vars:
if: github.repository_owner == 'Yorubaname'
runs-on: ubuntu-latest
environment: PROD
outputs:
service_name: ${{ vars.WEBSITE_SERVICE_NAME }}
service_path: ${{ vars.WEBSITE_SERVICE_PATH }}
steps:
- run: echo "Exposing vars to reusable workflow."

deploy:
if: github.repository_owner == 'Yorubaname'
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.service_name }}
service-path: ${{ needs.fetch-vars.outputs.service_path }}
environment: PROD

0 comments on commit b824103

Please sign in to comment.