name: Deploy on: schedule: - cron: "*/30 * * * *" push: branches: - "main" workflow_dispatch: jobs: build: name: Build runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - uses: oven-sh/setup-bun@v2 - run: bun install - name: Setup SSH Key uses: webfactory/ssh-agent@v0.9.1 with: ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} - run: git clone ${{ vars.ARTICLES_REPOSITORY }} articles - run: bun run build - uses: actions/upload-artifact@v7 with: name: production-files path: ./dist deploy: name: Deploy needs: build runs-on: ubuntu-latest steps: - uses: actions/download-artifact@v8 with: name: production-files path: ./dist - run: tar -czC dist -f dist.tar.gz . - run: | curl -v -X PUT -H 'X-Token: ${{ secrets.STAPLER_TOKEN }}' -H 'X-Host-Only: ${{ vars.TARGET_HOST }}' -H 'X-SPA: index.html' --data-binary "@dist.tar.gz" ${{ vars.STAPLER_TARGET }}