Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@

# Deploy workflow
#
# Website deployment to the FreeCAD staging or production containers.
# Manual trigger only by workflow_dispatch. The chosen environment supplies the
# host, account, and key, and its protection rules control the run.


name: Deploy
run-name: Deploy to ${{ inputs.environment }} by @${{ github.triggering_actor }}

on:
workflow_dispatch:
inputs:
environment:
description: Environment to deploy to
type: choice
options:
- staging
- production
default: staging

permissions:
contents: read

concurrency:
group: deploy-${{ inputs.environment }}
cancel-in-progress: false

jobs:
deploy:
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
timeout-minutes: 10

steps:
- name: Configure SSH
env:
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
DEPLOY_KNOWN_HOSTS: ${{ secrets.DEPLOY_KNOWN_HOSTS }}
run: |
install -m 700 -d ~/.ssh
printf '%s\n' "$DEPLOY_KEY" > ~/.ssh/deploy_key
chmod 600 ~/.ssh/deploy_key
printf '%s\n' "$DEPLOY_KNOWN_HOSTS" > ~/.ssh/known_hosts

# The server-side deploy is pinned as a forced command in the deploy
# account's authorized_keys, so no command is sent here.
- name: Deploy
env:
DEPLOY_TARGET: ${{ vars.DEPLOY_USER }}@${{ vars.DEPLOY_HOST }}
run: |
ssh \
-i ~/.ssh/deploy_key \
-o IdentitiesOnly=yes \
-o BatchMode=yes \
-o StrictHostKeyChecking=yes \
-o ConnectTimeout=15 \
-n \
"$DEPLOY_TARGET"
48 changes: 0 additions & 48 deletions .github/workflows/staging.yaml

This file was deleted.

Loading