diff --git a/.gitea/workflows/cicd.yml b/.gitea/workflows/cicd.yml new file mode 100644 index 0000000..7ce5987 --- /dev/null +++ b/.gitea/workflows/cicd.yml @@ -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" \ No newline at end of file