fix: gebruik officiële checkout actie ipv lokaal pad
This commit is contained in:
1 parent
2f96ad63f0
commit
3bf9765917
1 file changed
+73
@@ -0,0 +1,73 @@
|
|||||||
|
name: CI
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
tags:
|
||||||
|
- "v*"
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check:
|
||||||
|
if: startsWith(gitea.ref_name, 'v') == false
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Check out repository code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
repository: ${{ gitea.repository }}
|
||||||
|
token: ${{ gitea.token }}
|
||||||
|
fetch-depth: 50
|
||||||
|
|
||||||
|
- name: Typecheck, lint, and test
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
echo "--- CI checks starten ---"
|
||||||
|
node scripts/check-node-toolchain.mjs
|
||||||
|
|
||||||
|
export SKIP_ENV_VALIDATION=1
|
||||||
|
export NODE_ENV=test
|
||||||
|
export DATABASE_URL="mysql://test:test@localhost:3306/test?charset=utf8mb4"
|
||||||
|
export AUTH_SECRET="ci-test-secret-key-that-is-long-enough"
|
||||||
|
export REDIS_URL="redis://127.0.0.1:6379?connect_timeout=1"
|
||||||
|
export BCRYPT_ROUNDS=4
|
||||||
|
|
||||||
|
pnpm install --frozen-lockfile
|
||||||
|
pnpm biome:lint
|
||||||
|
pnpm typecheck
|
||||||
|
pnpm test
|
||||||
|
pnpm knip
|
||||||
|
echo "--- CI checks passed ---"
|
||||||
|
|
||||||
|
deploy:
|
||||||
|
needs: check
|
||||||
|
if: gitea.event_name == 'push' && gitea.ref_name == 'main'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Check out repository code for deploy
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
repository: ${{ gitea.repository }}
|
||||||
|
token: ${{ gitea.token }}
|
||||||
|
|
||||||
|
- name: Build and Deploy Container
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
echo "--- Start Docker Build & Deploy ---"
|
||||||
|
|
||||||
|
docker build -t epicnext-cms:latest .
|
||||||
|
|
||||||
|
docker stop epicnext-cms-app 2>/dev/null || true
|
||||||
|
docker rm epicnext-cms-app 2>/dev/null || true
|
||||||
|
|
||||||
|
docker run -d \
|
||||||
|
--name epicnext-cms-app \
|
||||||
|
--restart always \
|
||||||
|
--net=host \
|
||||||
|
epicnext-cms:latest
|
||||||
|
|
||||||
|
docker image prune -f
|
||||||
|
echo "--- Deployment succesvol afgerond! ---"
|
||||||
Reference in new issue
Block a user