Skip to content

feat(DAN-13): adds expressJS and openAI initial config #1

feat(DAN-13): adds expressJS and openAI initial config

feat(DAN-13): adds expressJS and openAI initial config #1

Workflow file for this run

name: Checks & Release
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
main:
name: Run checks and deploy
runs-on: [self-hosted, fear]
steps:
- name: Check out Git repository
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 16
- name: Set GitHub packages registry
run: |
npm config set '//npm.pkg.github.com/:_authToken' ${{ secrets.GH_TOKEN }}
npm config set @typeform:registry https://npm.pkg.github.com/
- name: Get yarn cache
uses: actions/cache@v2
id: yarn-cache
with:
path: node_modules
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('.github/workflows/**.yml') }}
- name: Install Node.js dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
- name: Run linter
run: yarn lint
# - name: Run tests
# run: yarn test --coverage
- name: Run compile
run: yarn compile
- name: Build image
run: |
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GH_TOKEN }}" > .npmrc
echo "@typeform:registry=https://npm.pkg.github.com" >> .npmrc
make build
if: ${{!contains(github.event.head_commit.message, 'chore')}}
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
GITHUB_SHA: ${GITHUB_SHA}
VERSION: ${GITHUB_RUN_ID}
ECR_REGISTRY: ${{ secrets.ECR_REGISTRY }}
- name: Push version images
if: ${{!contains(github.event.head_commit.message, 'chore')}}
run: make push
env:
VERSION: ${GITHUB_RUN_ID}
ECR_REGISTRY: ${{ secrets.ECR_REGISTRY }}
- name: Push latest images
if: github.ref == 'refs/heads/main' && !contains(github.event.head_commit.message, 'chore')
run: make push
env:
VERSION: 'latest'
ECR_REGISTRY: ${{ secrets.ECR_REGISTRY }}
- name: Deploy
if: github.ref == 'refs/heads/main' && !contains(github.event.head_commit.message, 'chore')
run: make deploy
env:
JENKINS_OKTA_USERNAME: ${{ secrets.JENKINS_OKTA_USERNAME }}
JENKINS_USER_TOKEN: ${{ secrets.JENKINS_USER_TOKEN }}
VERSION: ${GITHUB_RUN_ID}
- name: Build number
run: echo ${GITHUB_RUN_ID}
# - name: Set SonarCloud project
# run: sed -i 's/sonar\.projectVersion=.*/sonar\.projectVersion=${{ github.run_id }}/' sonar-project.properties
# - name: SonarCloud Scan
# uses: SonarSource/sonarcloud-github-action@master
# env:
# GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}