Skip to content

Commit

Permalink
Merge pull request #89 from norcalipa/norcalipa/hosting-at-home-2
Browse files Browse the repository at this point in the history
Adding action to ssh deploy to fats
  • Loading branch information
norcalipa authored Apr 3, 2024
2 parents 4d79647 + c8a5700 commit bc14243
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/deploy-home.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Deploy to Kubernetes on Fats

on:
push:
branches:
- main

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}

- name: Install Cloudflared
run: |
wget https://bin.equinox.io/c/VdrWdbjqyF/cloudflared-stable-linux-amd64.deb
sudo dpkg -i cloudflared-stable-linux-amd64.deb
- name: Deploy to Kubernetes
run: |
cloudflared tunnel --hostname ${SSH_HOST} --url ssh://${SSH_HOST}
ssh -o ProxyCommand='cloudflared access ssh --hostname %h' -o StrictHostKeyChecking=no ${{ secrets.SSH_USERNAME }}@${{ secrets.SSH_HOST }} <<EOF
k0s kubectl apply -f deployment.yaml
EOF

0 comments on commit bc14243

Please sign in to comment.