Move timestamp generation to separate job
This commit is contained in:
@@ -25,6 +25,9 @@ jobs:
|
||||
- run:
|
||||
name: Build CSS and JavaScript
|
||||
command: npm run build
|
||||
- run:
|
||||
name: Generate timestamp
|
||||
command: bash build/generate_timestamp.sh
|
||||
- run:
|
||||
name: Deploy theme
|
||||
command: bash build/deploy.sh
|
||||
|
||||
6
build/deploy.sh
Normal file → Executable file
6
build/deploy.sh
Normal file → Executable file
@@ -5,10 +5,6 @@ hash rsync 2>/dev/null || { echo >&2 "Error: rsync is not installed. Aborting.";
|
||||
[ -z "$SSH_IP" ] && { echo >&2 "Error: SSH_IP is missing. Aborting."; exit 1; }
|
||||
[ -z "$SSH_USER" ] && { echo >&2 "Error: SSH_USER is missing. Aborting."; exit 1; }
|
||||
|
||||
# Write deploy timestamp to disk
|
||||
timestamp=$(date +%s)
|
||||
echo $timestamp > ./theme/.timestamp
|
||||
|
||||
# Deploy theme with rsync
|
||||
rsync -e "ssh -o StrictHostKeyChecking=no" -avzuh --progress \
|
||||
theme/* $SSH_USER@$SSH_IP:~/windycoys_theme
|
||||
theme/. $SSH_USER@$SSH_IP:~/windycoys_theme
|
||||
|
||||
5
build/generate_timestamp.sh
Executable file
5
build/generate_timestamp.sh
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Write deploy timestamp to disk
|
||||
timestamp=$(date +%s)
|
||||
echo $timestamp > theme/.timestamp
|
||||
0
build/purge_cache.sh
Normal file → Executable file
0
build/purge_cache.sh
Normal file → Executable file
Reference in New Issue
Block a user