From aae29cb664e75d5ae6a32f602b555e05fed8cbb7 Mon Sep 17 00:00:00 2001 From: Nico Kaiser Date: Fri, 22 Nov 2024 09:24:24 +0100 Subject: [PATCH] replace pages deployment with ssh --- .github/workflows/build.yml | 30 ++++++++++++++++++++++++++++++ .github/workflows/pages.yml | 26 -------------------------- 2 files changed, 30 insertions(+), 26 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/pages.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..24c1eaf3 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,30 @@ +on: + push: + branches: + - main + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: 'npm' + - run: npm ci + - run: npm run build + - uses: actions/upload-artifact@v4 + with: + name: bandoneon + path: dist + if-no-files-found: error + - name: Upload to server + run: | + mkdir -p ~/.ssh + chmod 700 ~/.ssh + echo "${{ secrets.ARTIFACT_SSH_KEY }}" > ~/.ssh/id_ed25519 + chmod 600 ~/.ssh/id_ed25519 + ssh-keyscan -p 22 ${{ secrets.ARTIFACT_HOST }} >> ~/.ssh/known_hosts + rsync -az --delete dist/ bandoneonapp@${{ secrets.ARTIFACT_HOST }}:/srv/bandoneonapp/public/ diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml deleted file mode 100644 index 27206dcd..00000000 --- a/.github/workflows/pages.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Deploy to Pages - -on: - push: - branches: ['main'] - -jobs: - deploy: - runs-on: ubuntu-latest - permissions: - contents: write - concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: 22 - cache: 'npm' - - run: npm ci - - run: npm run build - - uses: peaceiris/actions-gh-pages@v4 - if: github.ref == 'refs/heads/main' - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./dist