From 725935267c4e933916acfbae997f99918262edc4 Mon Sep 17 00:00:00 2001 From: anatolykopyl Date: Mon, 10 Jun 2024 01:59:12 +0300 Subject: [PATCH 1/6] Add ci --- .gitea/workflows/deploy.yaml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .gitea/workflows/deploy.yaml diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml new file mode 100644 index 0000000..097a62f --- /dev/null +++ b/.gitea/workflows/deploy.yaml @@ -0,0 +1,19 @@ +name: Gitea Actions Demo +run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀 +on: [push] + +jobs: + Explore-Gitea-Actions: + runs-on: ubuntu-latest + steps: + - run: echo "The job was automatically triggered by a ${{ gitea.event_name }} event." + - run: echo "This job is now running on a ${{ runner.os }} server hosted by Gitea!" + - run: echo "The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}." + - name: Check out repository code + uses: actions/checkout@v4 + - run: echo "The ${{ gitea.repository }} repository has been cloned to the runner." + - run: echo "The workflow is now ready to test your code on the runner." + - name: List files in the repository + run: | + ls ${{ gitea.workspace }} + - run: echo "This job's status is ${{ job.status }}." -- 2.49.1 From f26a85707020aced833bc9d4c127e10b216b3d3d Mon Sep 17 00:00:00 2001 From: anatolykopyl Date: Mon, 10 Jun 2024 02:06:06 +0300 Subject: [PATCH 2/6] Build in ci --- .gitea/workflows/deploy.yaml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 097a62f..4abf23a 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -6,14 +6,9 @@ jobs: Explore-Gitea-Actions: runs-on: ubuntu-latest steps: - - run: echo "The job was automatically triggered by a ${{ gitea.event_name }} event." - - run: echo "This job is now running on a ${{ runner.os }} server hosted by Gitea!" - - run: echo "The name of your branch is ${{ gitea.ref }} and your repository is ${{ gitea.repository }}." - name: Check out repository code uses: actions/checkout@v4 - - run: echo "The ${{ gitea.repository }} repository has been cloned to the runner." - - run: echo "The workflow is now ready to test your code on the runner." - - name: List files in the repository - run: | - ls ${{ gitea.workspace }} - - run: echo "This job's status is ${{ job.status }}." + - name: Install dependencies + run: npm ci + - name: Build project + run: npm run build -- 2.49.1 From bda61b13027d8cf10803c8d1710da761c5543892 Mon Sep 17 00:00:00 2001 From: anatolykopyl Date: Mon, 10 Jun 2024 02:07:28 +0300 Subject: [PATCH 3/6] yarn --- .gitea/workflows/deploy.yaml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 4abf23a..87d2de3 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -1,5 +1,4 @@ -name: Gitea Actions Demo -run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀 +name: Deploy on: [push] jobs: @@ -9,6 +8,6 @@ jobs: - name: Check out repository code uses: actions/checkout@v4 - name: Install dependencies - run: npm ci + run: yarn install --frozen-lockfile - name: Build project - run: npm run build + run: yarn build -- 2.49.1 From 57afc4dca186a623ee93ec14ed040a6b7303f607 Mon Sep 17 00:00:00 2001 From: anatolykopyl Date: Mon, 10 Jun 2024 09:48:04 +0300 Subject: [PATCH 4/6] Add yarn --- .gitea/workflows/{deploy.yaml => ci.yaml} | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) rename .gitea/workflows/{deploy.yaml => ci.yaml} (81%) diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/ci.yaml similarity index 81% rename from .gitea/workflows/deploy.yaml rename to .gitea/workflows/ci.yaml index 87d2de3..36dc93d 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/ci.yaml @@ -2,11 +2,13 @@ name: Deploy on: [push] jobs: - Explore-Gitea-Actions: + Deploy: runs-on: ubuntu-latest steps: - name: Check out repository code uses: actions/checkout@v4 + - name: Install yarn + run: npm i -g yarn - name: Install dependencies run: yarn install --frozen-lockfile - name: Build project -- 2.49.1 From aa160feb02acb7f62cabbb827f1e952398db3834 Mon Sep 17 00:00:00 2001 From: anatolykopyl Date: Mon, 10 Jun 2024 11:46:35 +0300 Subject: [PATCH 5/6] Deploy --- .gitea/workflows/ci.yaml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 36dc93d..5df6915 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -2,14 +2,33 @@ name: Deploy on: [push] jobs: - Deploy: + build-and-deploy: runs-on: ubuntu-latest steps: - name: Check out repository code uses: actions/checkout@v4 + - name: Install yarn run: npm i -g yarn + - name: Install dependencies run: yarn install --frozen-lockfile + - name: Build project run: yarn build + + - name: Set up SSH + uses: webfactory/ssh-agent@v0.5.3 + with: + ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }} + + - name: Deploy to Server + env: + SSH_USER: ${{ secrets.DEPLOY_USER }} + SSH_HOST: ${{ secrets.DEPLOY_HOST }} + SSH_PORT: ${{ secrets.DEPLOY_PORT }} + DEPLOY_PATH: ${{ secrets.DEPLOY_PATH }} + run: | + echo "Deploying to ${SSH_USER}@${SSH_HOST}:${DEPLOY_PATH}" + ssh -o StrictHostKeyChecking=no -p ${SSH_PORT} ${SSH_USER}@${SSH_HOST} "mkdir -p ${DEPLOY_PATH}" + scp -o StrictHostKeyChecking=no -P ${SSH_PORT} -r dist/* ${SSH_USER}@${SSH_HOST}:${DEPLOY_PATH} -- 2.49.1 From e2c94f693303f3416e2b6de29dadb2a510594b39 Mon Sep 17 00:00:00 2001 From: anatolykopyl Date: Mon, 10 Jun 2024 11:54:01 +0300 Subject: [PATCH 6/6] Master only --- .gitea/workflows/ci.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 5df6915..0c3205e 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -1,5 +1,8 @@ name: Deploy -on: [push] +on: + push: + branches: + - master jobs: build-and-deploy: -- 2.49.1