From 059ca197e506a6fede12bc6e632b79cf7c085258 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Carlos=20Manzanero=20Dom=C3=ADnguez?= Date: Mon, 8 Jul 2024 19:07:36 -0600 Subject: [PATCH 1/7] add github actions for deploying to vps --- .github/workflows/cd.yml | 23 +++++++++++++++++++++++ .github/workflows/ci.yml | 19 +++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 .github/workflows/cd.yml create mode 100644 .github/workflows/ci.yml 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..acc388d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,19 @@ +name: CI + +on: + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - name: Build project + uses: actions/setup-node@v2 + with: + node-version: 20.x + - run: pnpm install + - run: pnpm run build From 23b4d23cec90a8aaec4534c11e072c9011136982 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Carlos=20Manzanero=20Dom=C3=ADnguez?= Date: Mon, 8 Jul 2024 19:11:07 -0600 Subject: [PATCH 2/7] update github actions --- .github/workflows/ci.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index acc388d..ae09ec7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,9 +10,14 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - name: git-checkout + uses: actions/checkout@v3 + + - name: pnpm-setup + uses: pnpm/action-setup@v2 + - name: Build project - uses: actions/setup-node@v2 + uses: pnpm/action-setup@v2 with: node-version: 20.x - run: pnpm install From 2b3e34817cd67d0356ff03f18a6d98b437e07259 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Carlos=20Manzanero=20Dom=C3=ADnguez?= Date: Mon, 8 Jul 2024 19:34:33 -0600 Subject: [PATCH 3/7] specify pnpm version --- .github/workflows/ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ae09ec7..e4e5973 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,8 +13,10 @@ jobs: - name: git-checkout uses: actions/checkout@v3 - - name: pnpm-setup - uses: pnpm/action-setup@v2 + - name: Setup pnpm + uses: pnpm/action-setup@v3 + with: + version: 9 - name: Build project uses: pnpm/action-setup@v2 From f20ed73523dd7d58096956e9893f71081c851394 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Carlos=20Manzanero=20Dom=C3=ADnguez?= Date: Mon, 8 Jul 2024 19:34:47 -0600 Subject: [PATCH 4/7] update pnpm --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e4e5973..6086c39 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: version: 9 - name: Build project - uses: pnpm/action-setup@v2 + uses: pnpm/action-setup@v3 with: node-version: 20.x - run: pnpm install From 2f03812e7e1f0abc7d50a35afd0f528c20bb54a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Carlos=20Manzanero=20Dom=C3=ADnguez?= Date: Mon, 8 Jul 2024 19:40:10 -0600 Subject: [PATCH 5/7] add pnpm version --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6086c39..4faebc8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,6 +21,6 @@ jobs: - name: Build project uses: pnpm/action-setup@v3 with: - node-version: 20.x + version: 9 - run: pnpm install - run: pnpm run build From 3b142e21b26c4884dda508c41cadcf3b3a95dac6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Carlos=20Manzanero=20Dom=C3=ADnguez?= Date: Mon, 8 Jul 2024 19:43:59 -0600 Subject: [PATCH 6/7] add env variable --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4faebc8..9d48ce6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,6 +5,8 @@ on: branches: - main +env: SECRET_POCKETBASE_API_URL=${{ vars.SECRET_POCKETBASE_API_URL }} + jobs: build: runs-on: ubuntu-latest From d80fa36054abb7ad3b890aae232b026a6caa3650 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Carlos=20Manzanero=20Dom=C3=ADnguez?= Date: Mon, 8 Jul 2024 19:45:15 -0600 Subject: [PATCH 7/7] fix syntax --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9d48ce6..ef6abe9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,7 +5,8 @@ on: branches: - main -env: SECRET_POCKETBASE_API_URL=${{ vars.SECRET_POCKETBASE_API_URL }} +env: + SECRET_POCKETBASE_API_URL: ${{ vars.SECRET_POCKETBASE_API_URL }} jobs: build: