diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 0000000..bf05c0a --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,23 @@ +name: CD + +on: + push: + branches: [main] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Deploy using ssh + uses: appleboy/ssh-action@master + with: + host: ${{ secrets.HOST }} + username: ${{ secrets.USERNAME }} + key: ${{ secrets.PRIVATE_KEY }} + port: ${{ secrets.PORT }} + script: | + cd ~/apps/website + git pull origin main + pnpm run install + pnpm run build + cp -r ./dist/* /var/www/website diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..ef6abe9 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,29 @@ +name: CI + +on: + pull_request: + branches: + - main + +env: + SECRET_POCKETBASE_API_URL: ${{ vars.SECRET_POCKETBASE_API_URL }} + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: git-checkout + uses: actions/checkout@v3 + + - name: Setup pnpm + uses: pnpm/action-setup@v3 + with: + version: 9 + + - name: Build project + uses: pnpm/action-setup@v3 + with: + version: 9 + - run: pnpm install + - run: pnpm run build