Fix SCP path for decrypted secrets in CD workflows

Write decrypted env files to infrastructure/ instead of /tmp/ so
strip_components: 1 correctly places them on the server.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ullrich Schäfer 2026-03-27 17:43:30 +01:00
parent 6e39d23dd4
commit e880e3e9d9
No known key found for this signature in database
GPG key ID: A32FF691A0F752D9
2 changed files with 11 additions and 13 deletions

View file

@ -64,9 +64,9 @@ jobs:
run: |
curl -sLO https://github.com/getsops/sops/releases/download/v3.9.4/sops-v3.9.4.linux.amd64
chmod +x sops-v3.9.4.linux.amd64
SOPS_AGE_KEY="${{ secrets.AGE_SECRET_KEY }}" ./sops-v3.9.4.linux.amd64 -d infrastructure/secrets.app.env > /tmp/app.env
echo "SENTRY_RELEASE=${{ github.sha }}" >> /tmp/app.env
echo "DOMAIN=trails.cool" >> /tmp/app.env
SOPS_AGE_KEY="${{ secrets.AGE_SECRET_KEY }}" ./sops-v3.9.4.linux.amd64 -d infrastructure/secrets.app.env > infrastructure/app.env
echo "SENTRY_RELEASE=${{ github.sha }}" >> infrastructure/app.env
echo "DOMAIN=trails.cool" >> infrastructure/app.env
- name: Copy files to server
uses: appleboy/scp-action@v1
@ -84,9 +84,9 @@ jobs:
host: ${{ secrets.DEPLOY_HOST }}
username: root
key: ${{ secrets.DEPLOY_SSH_KEY }}
source: "/tmp/app.env"
source: "infrastructure/app.env"
target: /opt/trails-cool
strip_components: 2
strip_components: 1
- name: Deploy via SSH
uses: appleboy/ssh-action@v1