From 761b8fb4733585ab3497ffa5c550f74f8e996c0b Mon Sep 17 00:00:00 2001 From: fuykaa Date: Mon, 2 Mar 2026 02:16:24 +0800 Subject: [PATCH 1/9] feat: add github actions test build --- .github/workflows/main.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..edfa3f4e --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,25 @@ +name: Test, Build, and Deploy | Modul 01 - Lab2.2 Senior Project + +on: + push: + branches: [main] + +jobs: + test-build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [16.x] + + steps: + - uses: actions/checkout@v2 + + - name: Testing Build pre-Deploy + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + cache: "npm" + + - run: npm i + - run: npm run build \ No newline at end of file From b34ac86379856116a12a2d936d2116acf2ee0688 Mon Sep 17 00:00:00 2001 From: fuykaa Date: Mon, 2 Mar 2026 07:26:49 +0800 Subject: [PATCH 2/9] benerin spasi --- .github/workflows/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index edfa3f4e..23bbc791 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,7 +14,6 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Testing Build pre-Deploy uses: actions/setup-node@v2 with: From 04f66fc9eae235526e0539d1349f081524f6365c Mon Sep 17 00:00:00 2001 From: fuykaa Date: Mon, 2 Mar 2026 07:29:40 +0800 Subject: [PATCH 3/9] hm --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 23bbc791..a28f4f98 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,11 +14,11 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Testing Build pre-Deploy - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} cache: "npm" - - run: npm i - run: npm run build \ No newline at end of file From d16e561b284e4293386bdcbe4f2c6ffe9b219b46 Mon Sep 17 00:00:00 2001 From: fuykaa Date: Mon, 2 Mar 2026 07:31:02 +0800 Subject: [PATCH 4/9] benerin spasi 2 --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a28f4f98..58a7fc3f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,10 +15,10 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Testing Build pre-Deploy + - name: Setup Node uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - cache: "npm" - - run: npm i + + - run: npm install - run: npm run build \ No newline at end of file From d6a0f03cdff2c1671139a92203b602b86f9d3f12 Mon Sep 17 00:00:00 2001 From: fuykaa Date: Mon, 2 Mar 2026 07:32:02 +0800 Subject: [PATCH 5/9] hmzzz --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 58a7fc3f..d2437985 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,7 @@ jobs: node-version: [16.x] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Setup Node uses: actions/setup-node@v3 From 588de60e2b80c2a82998557fe5e0ef7643887fe5 Mon Sep 17 00:00:00 2001 From: fuykaa Date: Mon, 2 Mar 2026 08:27:19 +0800 Subject: [PATCH 6/9] bismillah --- .github/workflows/main.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d2437985..43f9a700 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,12 +13,20 @@ jobs: node-version: [16.x] steps: - - uses: actions/checkout@v3 + # Step 1: Checkout repository + - uses: actions/checkout@v2 - - name: Setup Node + # Step 2: Setup Node.js dan cache npm dengan v3 + - name: Setup Node.js uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} + cache: "npm" - - run: npm install - - run: npm run build \ No newline at end of file + # Step 3: Install dependencies + - name: Install dependencies + run: npm install + + # Step 4: Build project + - name: Build project + run: npm run build \ No newline at end of file From e44d6c81abe1c714ad4adaedce09ac3a500f7e57 Mon Sep 17 00:00:00 2001 From: fuykaa Date: Mon, 2 Mar 2026 08:30:07 +0800 Subject: [PATCH 7/9] alahh --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 43f9a700..c23d8e4a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,7 +21,7 @@ jobs: uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - cache: "npm" + #cache: "npm" # Step 3: Install dependencies - name: Install dependencies From 565f5d4c02f6589ff18f37e6afa2b3f663c45c69 Mon Sep 17 00:00:00 2001 From: fuykaa Date: Mon, 2 Mar 2026 08:46:18 +0800 Subject: [PATCH 8/9] update file main.yml ke 1 --- .github/workflows/main.yml | 54 +++++++++++++++++++++++++++++--------- 1 file changed, 41 insertions(+), 13 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c23d8e4a..ecab305c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,26 +7,54 @@ on: jobs: test-build: runs-on: ubuntu-latest - strategy: matrix: node-version: [16.x] - steps: - # Step 1: Checkout repository - uses: actions/checkout@v2 - # Step 2: Setup Node.js dan cache npm dengan v3 - - name: Setup Node.js - uses: actions/setup-node@v3 + - name: Testing Build pre-Deploy + uses: actions/setup-node@v2 with: node-version: ${{ matrix.node-version }} - #cache: "npm" + cache: "npm" - # Step 3: Install dependencies - - name: Install dependencies - run: npm install + - run: npm i + - run: npm run build - # Step 4: Build project - - name: Build project - run: npm run build \ No newline at end of file + deploy: + needs: test-build + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [16.x] + steps: + - name: Build app on VM + uses: appleboy/ssh-action@master + with: + host: ${{ secrets.HOST }} + username: ${{ secrets.USERNAME }} + password: ${{ secrets.PASSWORD }} + port: ${{ secrets.PORT }} + script: | + eval "$(ssh-agent -s)" + ssh-add ~/.ssh/ssh-praktikan23 + echo "Cek folder project" + if [ ! -d "${HOME}/senpro/515523/modul02/senpro-github-action/" ]; then + echo "Repository belum di-clone. Cloning..." + mkdir -p ~/senpro/515523/modul02 + cd ~/senpro/515523/modul02 + git clone https://github.com/fuykaa/senpro-github-action.git + cd ~/senpro/515523/modul02/senpro-github-action + echo "Install Package dan Build Project" + npm install + npm run build + else + echo "Repository sudah ada. Building..." + cd ~/senpro/515523/modul02/senpro-github-action + git restore . + git pull origin main + echo "Install Package dan Build Project" + npm install + npm run build + fi \ No newline at end of file From 747146e5e533b90af65aa32ba4579e8ba11e13fb Mon Sep 17 00:00:00 2001 From: fuykaa Date: Mon, 2 Mar 2026 08:52:25 +0800 Subject: [PATCH 9/9] update file main.yml ke 2 kali --- .github/workflows/main.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ecab305c..1e758d67 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,27 +7,30 @@ on: jobs: test-build: runs-on: ubuntu-latest + strategy: matrix: node-version: [16.x] + steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Testing Build pre-Deploy - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - cache: "npm" - - run: npm i + - run: npm ci - run: npm run build deploy: needs: test-build runs-on: ubuntu-latest + strategy: matrix: node-version: [16.x] + steps: - name: Build app on VM uses: appleboy/ssh-action@master @@ -40,7 +43,7 @@ jobs: eval "$(ssh-agent -s)" ssh-add ~/.ssh/ssh-praktikan23 echo "Cek folder project" - if [ ! -d "${HOME}/senpro/515523/modul02/senpro-github-action/" ]; then + if [ ! -d "$HOME/senpro/515523/modul02/senpro-github-action/" ]; then echo "Repository belum di-clone. Cloning..." mkdir -p ~/senpro/515523/modul02 cd ~/senpro/515523/modul02