Skip to content

Create action workflow for CI/CD deployment #1

Create action workflow for CI/CD deployment

Create action workflow for CI/CD deployment #1

Workflow file for this run

# Created with assistance from GPT-5.6 Terra High
name: CI/CD - Deploy to VM
on:
push:

Check failure on line 5 in .github/workflows/deploy-to-vm.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/deploy-to-vm.yaml

Invalid workflow file

You have an error in your yaml syntax on line 5
branches:
- main
jobs:
deploy:
runs-on: [self-hosted]
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: |
mkdir -p "$TEMPDIR"
npm ci --no-audit --no-fund
- name: Build app
run: npm run Build
- name: Deploy app to apache
run: |
set -euo pipefail
test -d "/var/www/html/project1"
test -f dist/index.html
rsync -a --delete --chmod=D755,F644 \
dist/ "/var/www/html/project1/"
- name: Cleanup job files
if: always()
run: |
set -euo pipefail
# Removes source checkout, node_modules, dist, npm cache, and TMPDIR.
# Keeps the runner's own _work directory intact.
if [ -d "$GITHUB_WORKSPACE" ]; then
find "$GITHUB_WORKSPACE" -mindepth 1 -maxdepth 1 \
-exec rm -rf -- {} +
fi