From fb906dab4eebe031907e9e7d68eb76ec46c69cf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christopher=20M=C3=BChl?= Date: Mon, 16 Feb 2026 11:08:39 +0100 Subject: [PATCH] Use Nomad dispatch - no custom code --- deploy-site/action.yaml | 45 ++++++++++++++++++----------------------- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/deploy-site/action.yaml b/deploy-site/action.yaml index 44f24b9..0f14aa9 100644 --- a/deploy-site/action.yaml +++ b/deploy-site/action.yaml @@ -1,50 +1,45 @@ name: Deploy Site -description: Deploy a static site to production +description: Deploy static site via Nomad dispatch inputs: site-name: - description: 'Site identifier (determines URL and deployment)' + description: 'Site identifier' required: true source-dir: - description: 'Directory containing the built site' + description: 'Directory containing built site' required: false default: '.' runs: using: composite steps: - - name: Package site + - name: Package artifact shell: bash run: | - echo "📦 Packaging ${{ inputs.site-name }}..." cd "${{ inputs.source-dir }}" tar czf /tmp/${{ inputs.site-name }}.tar.gz . - echo "✓ Packaged $(du -h /tmp/${{ inputs.site-name }}.tar.gz | cut -f1)" - - name: Deploy via API + - name: Upload artifact shell: bash run: | - echo "🚀 Deploying ${{ inputs.site-name }}..." + ARTIFACT_URL="http://artifacts.intern.muehl.dev/${{ github.sha }}.tar.gz" - # TODO: Replace with actual deployment endpoint - # For now, use rsync + nomad dispatch + curl -X PUT \ + --data-binary @/tmp/${{ inputs.site-name }}.tar.gz \ + "$ARTIFACT_URL" - # Extract to deployment location - ssh deploy@alvin "mkdir -p /var/www/sites/${{ inputs.site-name }}" - scp /tmp/${{ inputs.site-name }}.tar.gz deploy@alvin:/tmp/ - ssh deploy@alvin "cd /var/www/sites/${{ inputs.site-name }} && tar xzf /tmp/${{ inputs.site-name }}.tar.gz" + echo "artifact_url=$ARTIFACT_URL" >> $GITHUB_OUTPUT - # Trigger deployment - ssh deploy@alvin "nomad job dispatch -meta site=${{ inputs.site-name }} deploy-site" - - echo "✅ Deployed!" - - - name: Show deployment info + - name: Deploy via Nomad shell: bash run: | - echo "" - echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" - echo "Site: ${{ inputs.site-name }}" - echo "URL: https://${{ inputs.site-name }}.toph.so" - echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" + nomad job dispatch static-site \ + -meta site_name=${{ inputs.site-name }} \ + -meta artifact_url=http://artifacts.intern.muehl.dev/${{ github.sha }}.tar.gz + + - name: Summary + shell: bash + run: | + echo "✅ Deployed ${{ inputs.site-name }}" + echo "🌐 https://${{ inputs.site-name }}.toph.so"