Created
November 23, 2022 20:31
-
-
Save phr3nzy/7eaa81d922167f3fa65acad7a7535145 to your computer and use it in GitHub Desktop.
Revisions
-
phr3nzy created this gist
Nov 23, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,54 @@ name: 'CI' on: push: branches: - main - staging jobs: test: runs-on: ubuntu-latest strategy: matrix: node-version: [14.x, 16.x, 18.x] fail-fast: true env: GHCR_PAT: ${{ secrets.GHCR_PAT }} steps: - uses: actions/checkout@v3 - uses: docker/setup-buildx-action@v1 - name: Docker Login run: echo $GHCR_PAT | docker login ghcr.io -u phr3nzy --password-stdin env: GHCR_PAT: ${{ secrets.GHCR_PAT }} - name: Start containers run: docker-compose -f "docker-compose.yml" up -d --build - name: Use Node.js ${{ matrix.node-version }} uses: actions/[email protected] with: node-version: ${{ matrix.node-version }} cache: 'yarn' - name: Install dependencies run: yarn install --frozen-lockfile - name: Lint run: yarn lint - name: Build run: yarn build:esbuild - name: Wait for Keycloak and Vault run: chmod -x ./wait-for-kc.sh && chmod -x ./wait-for-vault.sh && sh ./wait-for-kc.sh && sh ./wait-for-vault.sh - name: Run tests run: yarn test:ci env: SERVICE_NAME: api-testing NODE_ENV: testing APP_ENV: testing LOG_LEVEL: debug DISABLE_LOGGING: false HOST: 0.0.0.0 PORT: 3000 DATABASE_URL: postgres://postgres:password123@localhost:5432/api CACHE_URL: redis://localhost:6379/ VAULT_ADDR: http://localhost:8200 VAULT_TOKEN: super_secret_vault_token - name: Stop containers if: always() run: docker-compose -f "docker-compose.yml" down