[//]: # (dependabot-start) ⚠️ **Dependabot is rebasing this PR** ⚠️ Rebasing might not happen immediately, so don't worry if this takes some time. Note: if you make any changes to this PR yourself, they will take precedence over the rebase. --- [//]: # (dependabot-end) Bumps [webfactory/ssh-agent](https://github.com/webfactory/ssh-agent) from 0.9.0 to 0.10.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/webfactory/ssh-agent/releases">webfactory/ssh-agent's releases</a>.</em></p> <blockquote> <h2>v0.10.0: Upgrade to node-24</h2> <p>This release upgrades from node 20 to node 24, preparing for Node 20's upcoming EOL and getting rid of the related warning message in GitHub.</p> <h2>What's Changed</h2> <ul> <li>use node24 by <a href="https://github.com/jimmymcpeter"><code>@jimmymcpeter</code></a> in <a href="https://redirect.github.com/webfactory/ssh-agent/pull/243">webfactory/ssh-agent#243</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/jimmymcpeter"><code>@jimmymcpeter</code></a> made their first contribution in <a href="https://redirect.github.com/webfactory/ssh-agent/pull/243">webfactory/ssh-agent#243</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/webfactory/ssh-agent/compare/v0.9.1...v0.10.0">https://github.com/webfactory/ssh-agent/compare/v0.9.1...v0.10.0</a></p> <h2>v0.9.1</h2> <h2>What's Changed</h2> <ul> <li>Acknowledge custom command inputs in cleanup.js by <a href="https://github.com/janopae"><code>@janopae</code></a> in <a href="https://redirect.github.com/webfactory/ssh-agent/pull/235">webfactory/ssh-agent#235</a></li> </ul> <h2>New Contributors</h2> <ul> <li><a href="https://github.com/janopae"><code>@janopae</code></a> made their first contribution in <a href="https://redirect.github.com/webfactory/ssh-agent/pull/235">webfactory/ssh-agent#235</a></li> </ul> <p><strong>Full Changelog</strong>: <a href="https://github.com/webfactory/ssh-agent/compare/v0.9.0...v0.9.1">https://github.com/webfactory/ssh-agent/compare/v0.9.0...v0.9.1</a></p> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/webfactory/ssh-agent/blob/master/CHANGELOG.md">webfactory/ssh-agent's changelog</a>.</em></p> <blockquote> <h1>Changelog</h1> <p>All notable changes to this project will be documented in this file.</p> <p>The format is based on <a href="https://keepachangelog.com/en/1.0.0/">Keep a Changelog</a>, and this project adheres to <a href="https://semver.org/spec/v2.0.0.html">Semantic Versioning</a>.</p> <h2>[Unreleased]</h2> <h2>v0.9.1 [2024-03-17]</h2> <h3>Fixed</h3> <ul> <li>Fix path used to execute ssh-agent in cleanup.js to respect custom paths set by input (<a href="https://redirect.github.com/webfactory/ssh-agent/issues/235">#235</a>)</li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/webfactory/ssh-agent/commit/e83874834305fe9a4a2997156cb26c5de65a8555"><code>e838748</code></a> use node24 (<a href="https://redirect.github.com/webfactory/ssh-agent/issues/243">#243</a>)</li> <li><a href="https://github.com/webfactory/ssh-agent/commit/a6f90b1f127823b31d4d4a8d96047790581349bd"><code>a6f90b1</code></a> Release v0.9.1</li> <li><a href="https://github.com/webfactory/ssh-agent/commit/72c0bfd31ab22a2e11716951e3f107a9647dc97e"><code>72c0bfd</code></a> Improve documentation on why we use os.userInfo()</li> <li><a href="https://github.com/webfactory/ssh-agent/commit/e3f1a8e046525bfed3725ef54a31ca91aed399f4"><code>e3f1a8e</code></a> Acknowledge custom command inputs in cleanup.js (<a href="https://redirect.github.com/webfactory/ssh-agent/issues/235">#235</a>)</li> <li><a href="https://github.com/webfactory/ssh-agent/commit/b504c19775343714e11b8c754e4fe1f02dc7b8e7"><code>b504c19</code></a> Update CHANGELOG.md</li> <li>See full diff in <a href="https://github.com/webfactory/ssh-agent/compare/v0.9.0...v0.10.0">compare view</a></li> </ul> </details> <br /> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
113 lines
3.4 KiB
YAML
113 lines
3.4 KiB
YAML
name: Deploy pleno-vue to Hetzner (staging)
|
|
|
|
on:
|
|
push:
|
|
branches: [master]
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: deploy-pleno-vue
|
|
cancel-in-progress: false
|
|
|
|
env:
|
|
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
|
|
DEPLOY_USER: ${{ secrets.DEPLOY_USER }}
|
|
|
|
jobs:
|
|
test-and-deploy:
|
|
name: Build + Deploy
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 25
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 1
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v7
|
|
with:
|
|
node-version: '20'
|
|
cache: 'npm'
|
|
|
|
- name: Install + Build
|
|
run: |
|
|
npm ci --ignore-scripts
|
|
npm run build
|
|
|
|
- name: Setup SSH
|
|
uses: webfactory/ssh-agent@v0.10.0
|
|
with:
|
|
ssh-private-key: ${{ secrets.DEPLOY_SSH_KEY }}
|
|
|
|
- name: Add host key
|
|
run: |
|
|
mkdir -p ~/.ssh
|
|
ssh-keyscan -H "$DEPLOY_HOST" >> ~/.ssh/known_hosts 2>/dev/null
|
|
|
|
- name: Pre-deploy snapshot
|
|
id: pre
|
|
run: |
|
|
ssh "$DEPLOY_USER@$DEPLOY_HOST" '
|
|
set -e
|
|
cd /opt/pleno-vue
|
|
git rev-parse HEAD > /tmp/last_deploy_sha
|
|
echo "pre_sha=$(cat /tmp/last_deploy_sha)" >> $GITHUB_OUTPUT
|
|
'
|
|
|
|
- name: Deploy
|
|
id: deploy
|
|
run: |
|
|
ssh "$DEPLOY_USER@$DEPLOY_HOST" '
|
|
set -e
|
|
cd /opt/pleno-vue
|
|
git fetch origin master
|
|
git reset --hard origin/master
|
|
npm ci --ignore-scripts
|
|
npm run build
|
|
sudo systemctl reload nginx || true
|
|
sudo systemctl reload pleno-vue || true
|
|
echo "Deploy complete: $(git rev-parse --short HEAD)"
|
|
'
|
|
|
|
- name: Smoke test
|
|
id: smoke
|
|
continue-on-error: true
|
|
env:
|
|
SMOKE_BASE_URL: ${{ secrets.SMOKE_BASE_URL }}
|
|
run: |
|
|
bash scripts/smoke-test.sh "$SMOKE_BASE_URL"
|
|
|
|
- name: Sergii Review Batch smoke test (TRU-96)
|
|
id: smoke_sergii
|
|
continue-on-error: true
|
|
env:
|
|
SMOKE_BASE_URL: ${{ secrets.SMOKE_BASE_URL }}
|
|
run: |
|
|
bash scripts/smoke-test-sergii.sh "$SMOKE_BASE_URL"
|
|
|
|
- name: Auto-rollback on smoke failure
|
|
if: steps.smoke.outcome == 'failure' || steps.smoke_sergii.outcome == 'failure'
|
|
run: |
|
|
reason="$([ "${{ steps.smoke.outcome }}" = 'failure' ] && echo 'generic smoke' || echo 'Sergii Review Batch smoke')"
|
|
echo "::error::$reason test failed — rolling back to ${{ steps.pre.outputs.pre_sha }}"
|
|
ssh "$DEPLOY_USER@$DEPLOY_HOST" '
|
|
set -e
|
|
cd /opt/pleno-vue
|
|
git reset --hard ${{ steps.pre.outputs.pre_sha }}
|
|
npm ci --ignore-scripts
|
|
npm run build
|
|
sudo systemctl reload nginx || true
|
|
'
|
|
|
|
- name: Post Slack status
|
|
if: always()
|
|
uses: slackapi/slack-github-action@v4.0.0
|
|
with:
|
|
channel-id: ${{ secrets.AI_DAILY_CHANNEL }}
|
|
payload: |
|
|
{
|
|
"text": "${{ job.status == 'success' && '✅' || '❌' }} Deploy *pleno-vue@${{ github.sha[0:7] }}* — ${{ job.status }}\n${{ steps.smoke.outcome == 'failure' && '⚠️ Generic smoke FAILED → auto-rolled back' || steps.smoke_sergii.outcome == 'failure' && '⚠️ Sergii Review Batch smoke FAILED → auto-rolled back' || '✓ Smoke (generic + Sergii) passed' }}"
|
|
}
|
|
env:
|
|
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
|