diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..e70c569 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,11 @@ +name: Build and Deploy + +on: + push: + branches: [main] + +jobs: + quality-checks: + uses: ./.github/workflows/quality-checks.yml + + # add steps to deploy to AWS with terraform diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml new file mode 100644 index 0000000..498e57a --- /dev/null +++ b/.github/workflows/pull-request.yml @@ -0,0 +1,8 @@ +name: Pull Request Validation + +on: + pull_request: + +jobs: + quality-checks: + uses: ./.github/workflows/quality-checks.yml diff --git a/.github/workflows/quality-checks.yml b/.github/workflows/quality-checks.yml new file mode 100644 index 0000000..5292dcf --- /dev/null +++ b/.github/workflows/quality-checks.yml @@ -0,0 +1,64 @@ +name: Quality Checks + +on: + workflow_call: + +jobs: + lint-types: + name: Typescript + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + - uses: bahmutov/npm-install@v1 + + - name: Typescript + run: npm run lint:types + + lint: + name: Lint + runs-on: ubuntu-latest + needs: [lint-types] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + - uses: bahmutov/npm-install@v1 + + - name: Eslint + run: npm run lint:check + + format: + name: Format + runs-on: ubuntu-latest + needs: [lint-types, lint] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + - uses: bahmutov/npm-install@v1 + + - name: Prettier + run: npm run format:check + + test: + name: Test + runs-on: ubuntu-latest + needs: [lint-types, lint, format] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + - uses: bahmutov/npm-install@v1 + + - name: Jest + run: npm run test + + build: + name: Build + runs-on: ubuntu-latest + needs: [lint-types, lint, format, test] + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + - uses: bahmutov/npm-install@v1 + + - name: Build project + run: npm run build