diff --git a/.github/workflows/deploy_to_ftp.yml b/.github/workflows/deploy_to_ftp.yml deleted file mode 100644 index 5d5cb67..0000000 --- a/.github/workflows/deploy_to_ftp.yml +++ /dev/null @@ -1,33 +0,0 @@ -on: - push: - branches: - - main - -name: 🚀 Deploy website on push -jobs: - web-deploy: - name: 🎉 Deploy - runs-on: ubuntu-latest - - steps: - - name: 🚚 Get latest code - uses: actions/checkout@v2 - - - name: Use Node.js 16 LTS - uses: actions/setup-node@v1 - with: - node-version: "16.15.0" - - - name: 🔨 Build Project - run: | - npm install - npm run build - - name: 📂 Sync files - uses: SamKirkland/FTP-Deploy-Action@4.1.0 - with: - server: ${{ secrets.ftp_server }} - username: ${{ secrets.ftp_username }} - password: ${{ secrets.ftp_password }} - local-dir: ./build/ - server-dir: ${{ secrets.ftp_server_dir }} - dangerous-clean-slate: false diff --git a/.github/workflows/deploy_with_scp.yml b/.github/workflows/deploy_with_scp.yml new file mode 100644 index 0000000..450c45e --- /dev/null +++ b/.github/workflows/deploy_with_scp.yml @@ -0,0 +1,35 @@ +name: 🚀 Deploy website on push +on: + push: + branches: + - main + +jobs: + build-and-deploy: + name: 🎉 Build and Deploy + runs-on: ubuntu-latest + + steps: + - name: 🚚 Checkout code + uses: actions/checkout@v2 + + - name: 🛠 Setup Node.js + uses: actions/setup-node@v2 + with: + node-version: '16' + + - name: 📦 Install dependencies + run: npm ci + + - name: 🔨 Build project + run: npm run build + + - name: 📂 Deploy to server + uses: appleboy/scp-action@master + with: + host: sl2201.web.hostpoint.ch + username: bkserfa + key: ${{ secrets.SSH_DEPLOY_KEY }} + source: "build/*" + target: "/home/bkserfa/www/haslo.ch" + strip_components: 1