Add version tracking to deploy workflow
All checks were successful
Deploy / deploy (push) Successful in 8s
All checks were successful
Deploy / deploy (push) Successful in 8s
This commit is contained in:
parent
8caa836102
commit
73395350e8
1 changed files with 3 additions and 1 deletions
|
|
@ -17,6 +17,7 @@ jobs:
|
||||||
- name: Deploy via SSH
|
- name: Deploy via SSH
|
||||||
run: |
|
run: |
|
||||||
REF="${{ github.event.inputs.ref || github.sha }}"
|
REF="${{ github.event.inputs.ref || github.sha }}"
|
||||||
|
SHORT_SHA=$(echo "${REF}" | cut -c1-7)
|
||||||
mkdir -p ~/.ssh
|
mkdir -p ~/.ssh
|
||||||
echo "${{ secrets.DEPLOY_SSH_KEY }}" > ~/.ssh/id_ed25519
|
echo "${{ secrets.DEPLOY_SSH_KEY }}" > ~/.ssh/id_ed25519
|
||||||
chmod 600 ~/.ssh/id_ed25519
|
chmod 600 ~/.ssh/id_ed25519
|
||||||
|
|
@ -26,7 +27,8 @@ jobs:
|
||||||
git fetch origin
|
git fetch origin
|
||||||
git checkout ${REF}
|
git checkout ${REF}
|
||||||
git pull origin main || true
|
git pull origin main || true
|
||||||
sudo docker compose up -d --build
|
export VITE_DEPLOYED_VERSION="v:${SHORT_SHA}"
|
||||||
|
sudo -E docker compose up -d --build
|
||||||
echo "${REF}" > .deployed-commit
|
echo "${REF}" > .deployed-commit
|
||||||
echo "Deployed: ${REF} at $(date -u +%Y-%m-%dT%H:%M:%SZ)"
|
echo "Deployed: ${REF} at $(date -u +%Y-%m-%dT%H:%M:%SZ)"
|
||||||
ENDSSH
|
ENDSSH
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue