Fix the undent in the run block in the YAML for Configure SSH #8
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
name: Email_Form_Gateway_Build_Test_And_Deploy | |
on: [push, pull_request] | |
jobs: | |
deploy: | |
name: "Deploy to senpaid" | |
runs-on: ubuntu-latest | |
if: github.event_name == 'push' && github.ref == 'refs/heads/master' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download and install go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.22.0' | |
- name: Print Go version | |
run: go version | |
- name: Run tests | |
run: CGO_ENABLED=0 go test -skip=SendEmail github.com/owenwaller/emailformgateway/... | |
- name: Build emailer test | |
run: CGO_ENABLED=0 go test -c -o ./emailer.test -run=SendEmail github.com/owenwaller/emailformgateway/emailer | |
- name: Listing | |
run: 'ls -al' | |
- name: Configure SSH | |
run: | | |
mkdir -p ~/.ssh/ | |
echo "$SSH_KEY" > ~/.ssh/gophercoders.key | |
chmod 600 ~/.ssh/gophercoders.key | |
cat >>~/.ssh/config <<END | |
Host gophercoders.com | |
HostName $SSH_HOST | |
User $SSH_USER | |
Port $SSH_PORT | |
IdentityFile ~/.ssh/gophercoders.key | |
StrictHostKeyChecking no | |
ProxyCommand openssl s_client -quiet -connect senpaid.com:$SSH_PORT -servername www.gophercoders.com | |
END | |
env: | |
SSH_KEY: ${{ secrets.SENPAID_SERVER_SSH_KEY }} | |
SSH_USER: ${{ secrets.SENPAID_SERVER_USERNAME }} | |
SSH_HOST: ${{ secrets.SENPAID_SERVER_HOSTNAME }} | |
SSH_PORT: ${{ secrets.SENPAID_SERVER_PORT }} | |
- name: List public dir | |
run: ssh gophercoders.com 'whoami; ls -l ~/' | |
- name: Delete ssh dir | |
if: ${{ always() }} | |
run: | | |
rm -rf ~/.ssh |