feat: add About and Pricing pages with routes #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: π Deploy DefiPulsex Landing page on Push | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
web-deploy: | |
name: π Deploy | |
runs-on: ubuntu-latest | |
steps: | |
- name: π Get latest code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: π Get last successful deployment commit | |
id: last-successful-commit | |
run: | | |
if [ -f .last_successful_deploy ]; then | |
LAST_SUCCESSFUL_SHA=$(cat .last_successful_deploy) | |
echo "Last successful deployment commit: $LAST_SUCCESSFUL_SHA" | |
else | |
LAST_SUCCESSFUL_SHA=$(git rev-parse HEAD~1) # Fallback to previous commit | |
echo "No previous deployment found. Using previous commit: $LAST_SUCCESSFUL_SHA" | |
fi | |
echo "last_successful_sha=$LAST_SUCCESSFUL_SHA" >> $GITHUB_OUTPUT | |
- name: π Prepare changed files for deployment | |
id: changed-files | |
run: | | |
LAST_SUCCESSFUL_SHA="${{ steps.last-successful-commit.outputs.last_successful_sha }}" | |
echo "Comparing changes since commit: $LAST_SUCCESSFUL_SHA" | |
# Get all changed files since last successful deployment | |
CHANGED_FILES=$(git diff --diff-filter=ACMRT --name-only $LAST_SUCCESSFUL_SHA HEAD) | |
echo "Files that changed:" | |
echo "$CHANGED_FILES" | |
if [ -z "$CHANGED_FILES" ]; then | |
echo "No files changed" | |
echo "has_changes=false" >> $GITHUB_OUTPUT | |
exit 0 | |
fi | |
# Create directory for changed files | |
mkdir -p staging | |
# Copy each changed file while maintaining structure | |
while IFS= read -r file; do | |
if [ -n "$file" ] && [ -f "$file" ]; then | |
echo "Processing file: $file" | |
target_dir="staging/$(dirname "$file")" | |
mkdir -p "$target_dir" | |
cp "$file" "staging/$file" | |
echo "Copied $file to staging/$file" | |
fi | |
done <<< "$CHANGED_FILES" | |
# Verify files were copied | |
if [ -d "staging" ] && [ "$(ls -A staging)" ]; then | |
echo "Files were successfully copied to staging directory" | |
echo "has_changes=true" >> $GITHUB_OUTPUT | |
else | |
echo "No files were copied to staging directory" | |
echo "has_changes=false" >> $GITHUB_OUTPUT | |
fi | |
# List contents recursively from inside staging | |
echo "Contents of staging directory (recursive):" | |
find . -type f | |
- name: π Sync changed files | |
uses: wlixcc/SFTP-Deploy-Action@v1.2.4 | |
with: | |
server: 46.202.195.31 | |
username: defipulsex | |
password: 5f2GHxmEs2PUXfVhcwgI | |
local_path: './' | |
remote_path: '/home/defipulsex/htdocs/www.defipulsex.org/' | |
sftp_only: true | |
sftpArgs: '-o ConnectTimeout=5' | |
exclude: | | |
**/.env | |
**/.git* | |
**/.git*/** | |
**/node_modules/** | |
.github | |
**/vendor/** | |
- name: π Update last successful deployment commit | |
if: steps.changed-files.outputs.has_changes == 'true' | |
run: | | |
echo "${{ github.sha }}" > .last_successful_deploy | |
echo "Updated last successful deployment commit to ${{ github.sha }}" | |
- name: π Deployment status | |
if: always() | |
run: | | |
if [ "${{ steps.changed-files.outputs.has_changes }}" == "true" ]; then | |
echo "Deployment completed with files" | |
else | |
echo "No files to deploy" | |
fi |