feat: combine ci/cd workflow and add test step

This commit is contained in:
wancat committed 2023-08-29 16:13:59 +08:00
1 parent 2bc94a33e2
commit f360d783f8
2 files changed
+25 -27

No files matched your search

+25 -5
View File
@@ -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:
-22
View File
@@ -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