update ci /cd system
All checks were successful
Testing Site CD / Update Development (push) Successful in 3m58s
All checks were successful
Testing Site CD / Update Development (push) Successful in 3m58s
simplify setup and add a merge check
This commit is contained in:
@@ -1,11 +1,11 @@
|
|||||||
name: Continuous Integration
|
name: Testing Site CD
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
Deploy:
|
deploy-testing-cd:
|
||||||
name: Update Development
|
name: Update Development
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
@@ -40,14 +40,20 @@ jobs:
|
|||||||
- name: Token Copy
|
- name: Token Copy
|
||||||
run: |
|
run: |
|
||||||
cd /var/www/html/milsim-site-v4
|
cd /var/www/html/milsim-site-v4
|
||||||
cp /workspace/17th-Ranger-Battalion-ORG/milsim-site-v4/.git/config .git/config
|
cp ${{ gitea.workspace }}/.git/config .git/config
|
||||||
chown nginx:nginx .git/config
|
chown nginx:nginx .git/config
|
||||||
|
|
||||||
- name: Update Application Code
|
- name: Update Application Code
|
||||||
run: |
|
run: |
|
||||||
cd /var/www/html/milsim-site-v4
|
cd /var/www/html/milsim-site-v4
|
||||||
|
version=`git log -1 --format=%H`
|
||||||
|
echo "Current Revision: $version"
|
||||||
|
echo "Updating to: ${{ github.sha }}"
|
||||||
sudo -u nginx git reset --hard
|
sudo -u nginx git reset --hard
|
||||||
|
sudo -u nginx git fetch --tags
|
||||||
sudo -u nginx git pull origin main
|
sudo -u nginx git pull origin main
|
||||||
|
new_version=`git log -1 --format=%H`
|
||||||
|
echo "Successfully updated to: $new_version"
|
||||||
|
|
||||||
- name: Update Shared Dependencies and Fix Permissions
|
- name: Update Shared Dependencies and Fix Permissions
|
||||||
run: |
|
run: |
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
name: Continuous Deployment
|
name: Live Site CD
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
- '*'
|
- '*'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
Deploy:
|
deploy-live-cd:
|
||||||
name: Update Deployment
|
name: Update Deployment
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
@@ -40,7 +40,7 @@ jobs:
|
|||||||
- name: Token Copy
|
- name: Token Copy
|
||||||
run: |
|
run: |
|
||||||
cd /var/www/html/milsim-site-v4
|
cd /var/www/html/milsim-site-v4
|
||||||
cp /workspace/17th-Ranger-Battalion-ORG/milsim-site-v4/.git/config .git/config
|
cp ${{ gitea.workspace }}/.git/config .git/config
|
||||||
chown nginx:nginx .git/config
|
chown nginx:nginx .git/config
|
||||||
|
|
||||||
- name: Update Application Code
|
- name: Update Application Code
|
||||||
58
.gitea/workflows/pull-request.yaml
Normal file
58
.gitea/workflows/pull-request.yaml
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
name: Pull Request CI
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
- synchronize
|
||||||
|
- reopened
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Update Deployment
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
steps:
|
||||||
|
- name: Update Node Environment
|
||||||
|
uses: actions/setup-node@v6
|
||||||
|
with:
|
||||||
|
node-version: 20.19
|
||||||
|
|
||||||
|
- name: Verify Local Environment
|
||||||
|
run: |
|
||||||
|
which npm
|
||||||
|
npm -v
|
||||||
|
which node
|
||||||
|
node -v
|
||||||
|
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v5
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
ref: 'main'
|
||||||
|
|
||||||
|
- name: Install Shared Dependencies
|
||||||
|
run: |
|
||||||
|
cd ${{ gitea.workspace }}/shared
|
||||||
|
npm install
|
||||||
|
|
||||||
|
- name: Install UI Dependencies
|
||||||
|
run: |
|
||||||
|
cd ${{ gitea.workspace }}/ui
|
||||||
|
npm install
|
||||||
|
|
||||||
|
- name: Install API Dependencies
|
||||||
|
run: |
|
||||||
|
cd ${{ gitea.workspace }}/api
|
||||||
|
npm install
|
||||||
|
|
||||||
|
- name: Build UI
|
||||||
|
run: |
|
||||||
|
cd ${{ gitea.workspace }}/ui
|
||||||
|
npm run build
|
||||||
|
|
||||||
|
- name: Build API
|
||||||
|
run: |
|
||||||
|
cd ${{ gitea.workspace }}/api
|
||||||
|
npm run build
|
||||||
Reference in New Issue
Block a user