Skip to content

Commit

Permalink
feat: Update CI for secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
letehaha committed Jul 16, 2023
1 parent b6f9482 commit 6826047
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/check-source-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,33 @@ jobs:
name: Lint source code
needs: prepare-dependencies
runs-on: ubuntu-latest
environment: development
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/prepare-local-env
- name: Make envfile
uses: SpicyPizza/create-envfile@v1
with:
envkey_APPLICATION_HOST: ${{ secrets.APPLICATION_HOST }}
envkey_APPLICATION_PORT: ${{ secrets.APPLICATION_PORT }}
envkey_APPLICATION_JWT_SECRET: ${{ secrets.APPLICATION_JWT_SECRET }}
envkey_APPLICATION_DB_HOST: ${{ secrets.APPLICATION_DB_HOST }}
envkey_APPLICATION_DB_USERNAME: ${{ secrets.APPLICATION_DB_USERNAME }}
envkey_APPLICATION_DB_PASSWORD: ${{ secrets.APPLICATION_DB_PASSWORD }}
envkey_APPLICATION_DB_DATABASE: ${{ secrets.APPLICATION_DB_DATABASE }}
envkey_APPLICATION_DB_PORT: ${{ secrets.APPLICATION_DB_PORT }}
envkey_APPLICATION_DB_DIALECT: ${{ secrets.APPLICATION_DB_DIALECT }}
envkey_APPLICATION_REDIS_HOST: ${{ secrets.APPLICATION_REDIS_HOST }}
directory: ./
file_name: .env.development
- name: Lint source code
run: npm run lint

tests:
name: Unit and e2e testing
needs: prepare-dependencies
runs-on: ubuntu-latest
environment: test
services:
postgres:
image: postgres:11.12-stretch
Expand All @@ -54,14 +71,45 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: ./.github/actions/prepare-local-env
- name: Make envfile
uses: SpicyPizza/create-envfile@v1
with:
envkey_APPLICATION_HOST: ${{ secrets.APPLICATION_HOST }}
envkey_APPLICATION_PORT: ${{ secrets.APPLICATION_PORT }}
envkey_APPLICATION_JWT_SECRET: ${{ secrets.APPLICATION_JWT_SECRET }}
envkey_APPLICATION_DB_HOST: ${{ secrets.APPLICATION_DB_HOST }}
envkey_APPLICATION_DB_USERNAME: ${{ secrets.APPLICATION_DB_USERNAME }}
envkey_APPLICATION_DB_PASSWORD: ${{ secrets.APPLICATION_DB_PASSWORD }}
envkey_APPLICATION_DB_DATABASE: ${{ secrets.APPLICATION_DB_DATABASE }}
envkey_APPLICATION_DB_PORT: ${{ secrets.APPLICATION_DB_PORT }}
envkey_APPLICATION_DB_DIALECT: ${{ secrets.APPLICATION_DB_DIALECT }}
envkey_APPLICATION_REDIS_HOST: ${{ secrets.APPLICATION_REDIS_HOST }}
directory: ./
file_name: .env.test
- name: Unit and e2e testing
run: npm run test

docker-build:
name: Build source code using Docker
runs-on: ubuntu-latest
environment: production
steps:
- uses: actions/checkout@v2
- name: Make envfile
uses: SpicyPizza/create-envfile@v1
with:
envkey_APPLICATION_HOST: ${{ secrets.APPLICATION_HOST }}
envkey_APPLICATION_PORT: ${{ secrets.APPLICATION_PORT }}
envkey_APPLICATION_JWT_SECRET: ${{ secrets.APPLICATION_JWT_SECRET }}
envkey_APPLICATION_DB_HOST: ${{ secrets.APPLICATION_DB_HOST }}
envkey_APPLICATION_DB_USERNAME: ${{ secrets.APPLICATION_DB_USERNAME }}
envkey_APPLICATION_DB_PASSWORD: ${{ secrets.APPLICATION_DB_PASSWORD }}
envkey_APPLICATION_DB_DATABASE: ${{ secrets.APPLICATION_DB_DATABASE }}
envkey_APPLICATION_DB_PORT: ${{ secrets.APPLICATION_DB_PORT }}
envkey_APPLICATION_DB_DIALECT: ${{ secrets.APPLICATION_DB_DIALECT }}
envkey_APPLICATION_REDIS_HOST: ${{ secrets.APPLICATION_REDIS_HOST }}
directory: ./
file_name: .env.production
- uses: ./.github/actions/docker-build
with:
docker-hub-username: ${{ secrets.DOCKER_HUB_USERNAME }}
Expand Down

0 comments on commit 6826047

Please sign in to comment.