diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..f0971cd --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,32 @@ +name: Deploy GridTV + +on: + push: + branches: + - main + - beta + +jobs: + deploy: + runs-on: ubuntu-latest + + steps: + - name: Start SSH agent + uses: webfactory/ssh-agent@v0.9.0 + with: + ssh-private-key: ${{ secrets.SSH_KEY }} + + - name: Add server to known_hosts + run: | + mkdir -p ~/.ssh + ssh-keyscan -H ${{ secrets.SSH_HOST }} >> ~/.ssh/known_hosts + + - name: Deploy main + if: github.ref == 'refs/heads/main' + run: | + ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} main + + - name: Deploy beta + if: github.ref == 'refs/heads/beta' + run: | + ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} beta