From b40f37c95938c00f44bb7d899dfacc102309e2c4 Mon Sep 17 00:00:00 2001 From: hizumi Date: Sun, 30 Nov 2025 18:18:36 -0600 Subject: [PATCH] cerate deployment configuration add continuous deployment yaml to execute on every push to main to build and make live --- .gitea/workflows/cd-deploy.yaml | 62 +++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .gitea/workflows/cd-deploy.yaml diff --git a/.gitea/workflows/cd-deploy.yaml b/.gitea/workflows/cd-deploy.yaml new file mode 100644 index 0000000..66e64f1 --- /dev/null +++ b/.gitea/workflows/cd-deploy.yaml @@ -0,0 +1,62 @@ +name: Continuous Deployment +on: + push: + +jobs: + Deploy: + name: Update Deployment + runs-on: ubuntu-latest + container: + volumes: + - /var/www/html/milsim-site-v4:/var/www/html/milsim-site-v4:rw + steps: + - name: Setup Local Environment + run: | + groupadd -g 989 nginx || true + useradd nginx -u 990 -g nginx -m || true + + - name: Verify Node Environment + run: | + npm -v + node -v + + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: 'main' + + - name: Token Copy + run: | + cd /var/www/html/milsim-site-v4 + cp /workspace/17th-Ranger-Battalion-ORG/milsim-site-v4/.git/config .git/config + chown nginx:nginx .git/config + + - name: Fix File Permissions + run: | + sudo chown -R nginx:nginx /var/www/html/milsim-site-v4 + sudo chmod -R u+w /var/www/html/milsim-site-v4 + + - name: Update Application Code + run: | + sudo -u nginx bash -c "cd /var/www/html/milsim-site-v4 && git reset --hard && git pull origin main" + + - name: Update Shared Dependencies + run: | + sudo -u nginx bash -c "cd /var/www/html/milsim-site-v4/shared && npm install" + + - name: Update UI Dependencies + run: | + sudo -u nginx bash -c "cd /var/www/html/milsim-site-v4/ui && npm install" + + - name: Update API Dependencies + run: | + sudo -u nginx bash -c "cd /var/www/html/milsim-site-v4/api && npm install" + + - name: Build UI + run: | + sudo -u nginx bash -c "cd /var/www/html/milsim-site-v4/ui && npm run build" + + - name: Build API + run: | + sudo -u nginx bash -c "cd /var/www/html/milsim-site-v4/api && npm run build"