Skip to content

Commit

Permalink
ci: improve GitHub Actions environment setup
Browse files Browse the repository at this point in the history
- Add a step to include public and private keys in the GitHub Actions environment
- Remove the `if: always()` condition from a job

Signed-off-by: Bo-Yi Wu <[email protected]>
  • Loading branch information
appleboy committed Jun 6, 2024
1 parent dfc4b57 commit 90639f8
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion .github/workflows/test2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,21 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: add public key to env
run: |
echo "PUBLIC_KEY<<EOF" >> $GITHUB_ENV
cat testdata/.ssh/id_rsa.pub >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
echo "======= public key ========="
cat testdata/.ssh/id_rsa.pub
echo "============================"
echo "PRIVATE_KEY<<EOF" >> $GITHUB_ENV
cat testdata/.ssh/id_rsa >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
echo "======= private key ========="
cat testdata/.ssh/id_rsa
echo "============================"
- name: Get sshd container IP
id: sshd
run: |
Expand All @@ -99,7 +114,6 @@ jobs:

- name: executing remote ssh commands using password (1.0.3)
uses: appleboy/[email protected]
if: always()
with:
host: ${{ steps.sshd.outputs.sshd_ip }}
username: linuxserver.io
Expand Down

0 comments on commit 90639f8

Please sign in to comment.