diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..0ae7419 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,76 @@ +name: Continuous Integration + +on: + # Trigger the workflow on push or pull request, + push: + branches: + - main + - develop + pull_request: {} + +jobs: + build: + name: Build the Site + runs-on: ubuntu-latest + env: + CI: true + steps: + - name: ⬇️ Checkout repo + uses: actions/checkout@v4 + + - name: Setup Node.js environment + uses: actions/setup-node@v3.8.1 + with: + # Version Spec of the version to use. Examples: 12.x, 10.15.1, >=10.15.0. + node-version: 20.10.0 + + - name: 📥 Download deps + run: npm install --frozen-lockfile + + - name: Build the Site + run: npm run build + + eslint-prettier: + name: ⬣ ESLint && 💅 Prettier + needs: build + runs-on: ubuntu-latest + permissions: write-all + steps: + - name: ⬇️ Checkout repo + uses: actions/checkout@v3 + + - name: Setup Node.js environment + uses: actions/setup-node@v3.8.1 + with: + # Version Spec of the version to use. Examples: 12.x, 10.15.1, >=10.15.0. + node-version: 16 + + - name: 📥 Download deps + uses: bahmutov/npm-install@v1 + + - name: Run linters + uses: wearerequired/lint-action@v2 + with: + auto_fix: true + eslint: true + prettier: true + + typecheck: + name: ʦ TypeScript + needs: build + runs-on: ubuntu-latest + steps: + - name: ⬇️ Checkout repo + uses: actions/checkout@v3 + + - name: Setup Node.js environment + uses: actions/setup-node@v3.8.1 + with: + # Version Spec of the version to use. Examples: 12.x, 10.15.1, >=10.15.0. + node-version: 16 + + - name: 📥 Download deps + uses: bahmutov/npm-install@v1 + + - name: 🔎 Type check + run: npm run typecheck diff --git a/.github/workflows/github-actions-demo.yml b/.github/workflows/github-actions-demo.yml deleted file mode 100644 index 15a61d6..0000000 --- a/.github/workflows/github-actions-demo.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: GitHub Actions Demo -run-name: ${{ github.actor }} is testing out GitHub Actions 🚀 -on: [push] -jobs: - Explore-GitHub-Actions: - runs-on: ubuntu-latest - steps: - - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event." - - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!" - - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}." - - name: Check out repository code - uses: actions/checkout@v4 - - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner." - - run: echo "🖥️ The workflow is now ready to test your code on the runner." - - name: List files in the repository - run: | - ls ${{ github.workspace }} - - run: echo "🍏 This job's status is ${{ job.status }}."