add test to CI
This commit is contained in:
30
.github/workflows/deploy.yml
vendored
30
.github/workflows/deploy.yml
vendored
@@ -2,12 +2,40 @@ name: Deploy App
|
|||||||
on: [push]
|
on: [push]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 20
|
||||||
|
- run: npm ci
|
||||||
|
- run: npm run build
|
||||||
|
- run: tar -czf build.tar.gz .output
|
||||||
|
- uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: nuxt-build
|
||||||
|
path: build.tar.gz
|
||||||
|
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
needs: build
|
||||||
|
steps:
|
||||||
|
- uses: actions/download-artifact@v4
|
||||||
|
with:
|
||||||
|
name: nuxt-build
|
||||||
|
- run: tar -xzf build.tar.gz
|
||||||
|
- run: npm ci --omit=dev
|
||||||
|
- run: npm run start &
|
||||||
|
- run: npx wait-on http://localhost:3000
|
||||||
|
- run: curl -f http://localhost:3000 || exit 1
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
needs: test
|
||||||
container:
|
container:
|
||||||
volumes:
|
volumes:
|
||||||
- /var/docker-web:/var/docker-web
|
- /var/docker-web:/var/docker-web
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- name: install
|
- name: install
|
||||||
|
|||||||
Reference in New Issue
Block a user