diff --git a/.github/workflows/validate-ts-version.yml b/.github/workflows/validate-ts-version.yml new file mode 100644 index 0000000..151da48 --- /dev/null +++ b/.github/workflows/validate-ts-version.yml @@ -0,0 +1,32 @@ +name: TS version validation + +on: + push: + +env: + TYPESCRIPT_VERSION: ${{ secrets.TYPESCRIPT_VERSION }} + SCRIPT_PATH: "./scripts/extract-typescript-version.js" + +jobs: + extract-version: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: '18' + + - name: Extract Version + id: extract_version + run: node ${{ env.SCRIPT_PATH }} + + - name: Check Version + run: | + if [ "${{ steps.extract_version.outputs.version }}" != "${{ env.TYPESCRIPT_VERSION }}" ]; then + echo "Please change the TypeScript version to ${{ env.TYPESCRIPT_VERSION }} in your _versions.ts file"; + exit 1; + fi diff --git a/.github/workflows/vercel-deployment.yml b/.github/workflows/vercel-deployment.yml index 7d8449b..738a295 100644 --- a/.github/workflows/vercel-deployment.yml +++ b/.github/workflows/vercel-deployment.yml @@ -2,31 +2,27 @@ name: Vercel Preview Deployment on: push: - -env: - TYPESCRIPT_VERSION: 0.1.1 - SCRIPT_PATH: "./scripts/extract-typescript-version.js" + branches: + - main + pull_request: jobs: - extract-version: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v3 - - name: Setup Node.js - uses: actions/setup-node@v2 - with: - node-version: '18' + lint-test: + uses: ai-cfia/github-workflows/.github/workflows/workflow-lint-test-node.yml@main - - name: Extract Version - id: extract_version - run: node ${{ env.SCRIPT_PATH }} + vercel-deployment-dev: + needs: lint-test + uses: ai-cfia/github-workflows/.github/workflows/workflow-vercel-deployment.yml@53-update-vercel-deployment-to-add-setup-node-step + with: + project-name: 'finesse-frontend' + deployment-environment: 'dev' + secrets: inherit - - name: Check Version - run: | - if [ "${{ steps.extract_version.outputs.version }}" != "${{ env.TYPESCRIPT_VERSION }}" ]; then - echo "You should be using typescript version ${{ env.TYPESCRIPT_VERSION }} "; - exit 1; - fi + vercel-deployment-uat: + if: github.ref == 'refs/heads/main' + uses: ai-cfia/github-workflows/.github/workflows/workflow-vercel-deployment.yml@53-update-vercel-deployment-to-add-setup-node-step + with: + project-name: 'finesse-frontend' + deployment-environment: 'uat' + secrets: inherit diff --git a/src/_versions.ts b/src/_versions.ts index 21b4b6f..667c9e0 100644 --- a/src/_versions.ts +++ b/src/_versions.ts @@ -9,7 +9,7 @@ export interface TsAppVersion { gitTag?: string; }; export const versions: TsAppVersion = { - version: '0.1.0', + version: '0.2.0', name: 'finesse-frontend', versionDate: '2023-12-04T21:25:19.734Z', gitCommitHash: '1b203ac',