refactor(workflow): enhance SSH setup and cleanup logic #43
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
pull_request: | |
branches: | |
- main | |
jobs: | |
test: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- macos-15 | |
- ubuntu-24.04 | |
- windows-2025 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Setup SSH key | |
uses: ./ | |
with: | |
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} | |
ssh-known-hosts: ${{ secrets.SSH_KNOWN_HOSTS }} | |
log-public-key: false | |
- name: Check known hosts file | |
uses: pyTooling/Actions/with-post-step@9ceefdbf5dceae8c441fc393ed82344c7ca8bbdb # v3.1.1 | |
env: | |
SSH_KNOWN_HOSTS: ${{ secrets.SSH_KNOWN_HOSTS }} | |
with: | |
main: | | |
sh check.sh | |
post: | | |
sh post_check.sh | |
- name: Install docker (Missing on MacOS) | |
if: runner.os == 'macos' | |
shell: bash | |
run: | | |
brew install --cask docker | |
- name: Deploy over SSH | |
shell: bash | |
env: | |
DOCKER_HOST: ${{ secrets.DOCKER_HOST }} | |
run: | | |
sh deploy.sh |