Add CI/CD workflow configuration
This commit is contained in:
43
.gitea/workflows/cicd.yml
Normal file
43
.gitea/workflows/cicd.yml
Normal file
@@ -0,0 +1,43 @@
|
||||
name: CI/CD Pipeline
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
build-and-test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: '16'
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm install -g http-server
|
||||
|
||||
- name: Run tests
|
||||
run: |
|
||||
# Add test commands here
|
||||
echo "Running tests..."
|
||||
ls -la
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
# Any build steps if needed
|
||||
echo "Build completed"
|
||||
|
||||
deploy:
|
||||
needs: build-and-test
|
||||
runs-on: self-hosted
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Deploy to server
|
||||
run: |
|
||||
# Copy files to web directory
|
||||
sudo mkdir -p /var/www/html/tic-tac-toe
|
||||
sudo cp -r ./index.html ./styles.css ./script.js ./PROJECT_PLAN.md ./README.md ./DEPLOYMENT.md ./DOCKER_DEPLOY.md /var/www/html/tic-tac-toe/
|
||||
echo "Deployment completed"
|
||||
Reference in New Issue
Block a user