Compare commits

12 Commits

3 changed files with 38 additions and 29 deletions

View File

@@ -0,0 +1,37 @@
name: Release
concurrency:
cancel-in-progress: true
group: test-pr-${{ github.event.pull_request.number }}
env:
ACT_OWNER: ${{ github.repository_owner }}
ACT_REPOSITORY: ${{ github.repository }}
CGO_ENABLED: 0
on:
pull_request:
types:
- opened
- synchronize
- reopened
jobs:
build_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- run: git fetch --force --tags
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: 22
- name: Install dependencies
run: npm ci --legacy-peer-deps
- name: Build libraries
run: npx nx run-many -t build
- name: Run tests
run: npx nx run-many -t test --code-coverage --passWithNoTests

1
.gitignore vendored
View File

@@ -44,3 +44,4 @@ Thumbs.db
vite.config.*.timestamp*
.cursor/rules/nx-rules.mdc
.github/instructions/nx.instructions.md
act_runner*

View File

@@ -1,29 +0,0 @@
deploy_staging:
stage: deploy
script:
- eval $(ssh-agent -s)
- echo "$SSH_REPO_KEY" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh && touch ~/.ssh/known_hosts
- echo "$SSH_STAGING_KNOWN_HOST" >> ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
# Make a temp folder
- ssh -p22 root@${STAGING_IP} "mkdir -p /var/www/html/${SITE_DIR}_tmp"
# Copy the files from the repo to the temp folder
- rsync -rav -e ssh --exclude='.git/' --exclude='.gitlab-ci.yml' --exclude='gulpfile.js' --delete-excluded ./ root@${STAGING_IP}:/var/www/html/${SITE_DIR}_tmp
# Rename current site into backup
- ssh -p22 root@${STAGING_IP} "mv /var/www/html/${SITE_DIR} /var/www/html/${SITE_DIR}_bak"
# Copy uploads folder to temp
- ssh -p22 root@${STAGING_IP} "cp -rf /var/www/html/${SITE_DIR}_bak/wp-content/uploads /var/www/html/${SITE_DIR}_tmp/wp-content/uploads"
# Make the temp folder the actual site
- ssh -p22 root@${STAGING_IP} "cp -rf /var/www/html/${SITE_DIR}_tmp /var/www/html/${SITE_DIR}"
# Set the ownership and permissions
- ssh -p22 root@${STAGING_IP} "find /var/www/html/${SITE_DIR} -type f -exec chmod 644 {} \;"
- ssh -p22 root@${STAGING_IP} "find /var/www/html/${SITE_DIR} -type d -exec chmod 755 {} \;"
- ssh -p22 root@${STAGING_IP} "chown -R www-data:www-data /var/www/html/${SITE_DIR}"
# Remove the old site
- ssh -p22 root@${STAGING_IP} "rm -rf /var/www/html/${SITE_DIR}_bak"
# Remove the temp site
- ssh -p22 root@${STAGING_IP} "rm -rf /var/www/html/${SITE_DIR}_tmp"
only:
- staging