diff --git a/.github/workflows/ci_cd.yml b/.github/workflows/ci_cd.yml index c240cd8..080e10e 100644 --- a/.github/workflows/ci_cd.yml +++ b/.github/workflows/ci_cd.yml @@ -1,12 +1,32 @@ -name: CI/CD Workflow +name: CI/CD on: push: - branches: - - main jobs: - build-and-push: + ci: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - uses: actions/setup-node@v3 + with: + node-version: 20 + + - name: Install dependencies + run: yarn install + + - name: Lint + run: yarn lint + + - name: Test + run: yarn test + + build: + needs: ci + if: github.ref == 'refs/heads/main' runs-on: ubuntu-latest steps: @@ -44,7 +64,7 @@ jobs: tags: docker.io/${{ secrets.DOCKERHUB_USERNAME }}/linux-odyssey:helloworld deploy: - needs: build-and-push + needs: build runs-on: ubuntu-latest steps: diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml deleted file mode 100644 index 01f475e..0000000 --- a/.github/workflows/eslint.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: ESLint Checks - -on: - push: - -jobs: - lint: - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - uses: actions/setup-node@v3 - with: - node-version: 20 - - - name: Install dependencies - run: yarn install - - - name: Lint - run: yarn lint