Skip to content

Commit

Permalink
Added secrets in GitHub Environment
Browse files Browse the repository at this point in the history
  • Loading branch information
GetRohitansh committed Sep 9, 2023
1 parent 0bb3f4d commit 482586a
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,20 @@ on:
# Since each step is executed on the same runner, you can share data from one step to another.
jobs:
job1:
environment: # fetch variable from github environment
name: testing
env:
# Database Environment Variables
DATABASE_HOSTNAME: localhost
DB_PASSWORD: password123
DATABASE_PORT: 5432
DATABASE_NAME: fastapi
DB_USERNAME: postgres
DATABASE_HOSTNAME: ${{secrets.DATABASE_HOSTNAME}} # fetches values from Github Action Secrets / Environment
DB_PASSWORD: ${{secrets.DB_PASSWORD}}
DATABASE_PORT: ${{secrets.DATABASE_PORT}}
DATABASE_NAME: ${{secrets.DATABASE_NAME}}
DB_USERNAME: ${{secrets.DB_USERNAME}}

# Authorization Environment Variables
SECRET_KEY: 09d25e094faa6ca2556c818166b7a9563b93f7099f6f0f4caa6cf63b88e8d3e7
ALGORITHM: HS256
ACCESS_TOKEN_EXPIRE_MINUTES: 30
SECRET_KEY: ${{secrets.SECRET_KEY}}
ALGORITHM: ${{secrets.ALGORITHM}}
ACCESS_TOKEN_EXPIRE_MINUTES: ${{secrets.ACCESS_TOKEN_EXPIRE_MINUTES}}

runs-on: ubuntu-latest
steps:
Expand Down

0 comments on commit 482586a

Please sign in to comment.