Files
evilspins/.github/workflows/deploy.yml
valere 655574171f
Some checks failed
Deploy App / build (push) Successful in 52s
Deploy App / deploy (push) Has been cancelled
Deploy App / test (push) Has been cancelled
gitea action ...
2025-09-18 10:17:57 +02:00

58 lines
1.3 KiB
YAML

name: Deploy App
on: [push]
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
# setup Node
- uses: actions/setup-node@v4
with:
node-version: 20
# installer pnpm globalement
- run: npm install -g pnpm
# install deps et build
- run: pnpm install --frozen-lockfile
- run: pnpm build
test:
runs-on: ubuntu-22.04
needs: build
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- run: npm install -g pnpm
# install uniquement les prod deps
- run: pnpm install --frozen-lockfile --prod
# démarrer le serveur et tester une route
- run: pnpm start &
- run: npx wait-on http://localhost:3000
- run: curl -f http://localhost:3000 || exit 1
deploy:
runs-on: ubuntu-22.04
needs: test
container:
volumes:
- /var/docker-web:/var/docker-web
steps:
- uses: actions/checkout@v4
- name: Deploy with docker-web
run: |
APP_DIR=/var/docker-web/apps/${GITHUB_REPOSITORY##*/}
mkdir -p $APP_DIR
cp -a $(find . -mindepth 1 -maxdepth 1 ! -name '.git' ! -name 'node_modules') "$APP_DIR/"
export COMPOSE_BAKE=false
bash /var/docker-web/src/cli.sh up ${GITHUB_REPOSITORY##*/}