cerate deployment configuration
Some checks failed
Continuous Deployment / Update Deployment (push) Failing after 2m16s
Some checks failed
Continuous Deployment / Update Deployment (push) Failing after 2m16s
add continuous deployment yaml to execute on every push to main to build and make live
This commit is contained in:
62
.gitea/workflows/cd-deploy.yaml
Normal file
62
.gitea/workflows/cd-deploy.yaml
Normal file
@@ -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"
|
||||
Reference in New Issue
Block a user