Skip to content

Commit

Permalink
Switch to SSH deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
nhusung committed May 26, 2024
1 parent 2bb3ce7 commit 99dddb5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/cpp.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: C++

# spell-checker:ignore awalsh,ctest,DCMAKE,doxyindexer,pkgs
# spell-checker:ignore awalsh,ctest,DCMAKE,doxyindexer,httpdocs,pkgs

on:
push:
Expand Down Expand Up @@ -78,11 +78,17 @@ jobs:
if: ${{ github.ref == 'refs/heads/main' }}
working-directory: build/doc/html
run: |
[ $(zip -r - . | curl -o /dev/stderr -s -w "%{response_code}" -u "$DEPLOY_TOKEN" --basic "$DEPLOY_URL/api/cpp/dev" --upload-file -) = 200 ]
mkdir -p ~/.ssh
echo "$KNOWN_HOSTS" >> ~/.ssh/known_hosts
remote_cmd="mkdir '$PATH'.new && tar -xzC '$PATH'.new && mv '$PATH'{,.old} && mv '$PATH'{.new,} && rm -rf '$PATH'.old"
ssh-agent sh -c "echo '$KEY' | ssh-add - && tar -cvz . | ssh -l '$USER' -p '$PORT' '$HOST' sh -c '$remote_cmd'"
env:
DEPLOY_TOKEN: ${{ secrets.WEBSITE_DEPLOY_TOKEN }}
DEPLOY_URL: ${{ secrets.WEBSITE_DEPLOY_URL }}

HOST: ${{ secrets.WEBSITE_SSH_HOST }}
USER: ${{ secrets.WEBSITE_SSH_USER }}
PORT: ${{ secrets.WEBSITE_SSH_PORT }}
KEY: ${{ secrets.WEBSITE_SSH_KEY }}
KNOWN_HOSTS: ${{ secrets.WEBSITE_SSH_KNOWN_HOSTS }}
PATH: /httpdocs/api/cpp/dev

test-linux:
name: Test (Linux)
Expand Down
16 changes: 11 additions & 5 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Python

# spell-checker:ignore awalsh,CIBW,jakebailey,pkgs,pydata,pyproject
# spell-checker:ignore awalsh,CIBW,httpdocs,jakebailey,pkgs,pydata,pyproject

on:
push:
Expand Down Expand Up @@ -54,11 +54,17 @@ jobs:
- name: Deploy Docs
if: ${{ github.ref == 'refs/heads/main' }}
working-directory: target/python/doc
run: |
[ $(zip -r - . | curl -o /dev/stderr -s -w "%{response_code}" -u "$DEPLOY_TOKEN" --basic "$DEPLOY_URL/api/python/dev" --upload-file -) = 200 ]
mkdir -p ~/.ssh
echo "$KNOWN_HOSTS" >> ~/.ssh/known_hosts
remote_cmd="mkdir '$PATH'.new && tar -xzC '$PATH'.new && mv '$PATH'{,.old} && mv '$PATH'{.new,} && rm -rf '$PATH'.old"
ssh-agent sh -c "echo '$KEY' | ssh-add - && tar -cvz . | ssh -l '$USER' -p '$PORT' '$HOST' sh -c '$remote_cmd'"
env:
DEPLOY_TOKEN: ${{ secrets.WEBSITE_DEPLOY_TOKEN }}
DEPLOY_URL: ${{ secrets.WEBSITE_DEPLOY_URL }}
HOST: ${{ secrets.WEBSITE_SSH_HOST }}
USER: ${{ secrets.WEBSITE_SSH_USER }}
PORT: ${{ secrets.WEBSITE_SSH_PORT }}
KEY: ${{ secrets.WEBSITE_SSH_KEY }}
KNOWN_HOSTS: ${{ secrets.WEBSITE_SSH_KNOWN_HOSTS }}
PATH: /httpdocs/api/python/dev

buildwheel-linux:
name: Build wheels for Linux
Expand Down

0 comments on commit 99dddb5

Please sign in to comment.