From 6b692c335cff87032359a3428448122620a9af8f Mon Sep 17 00:00:00 2001 From: zildirayalfirli Date: Tue, 5 Mar 2024 08:18:02 +0700 Subject: [PATCH 01/11] add --- .github/workflows/main.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 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..35b5e76c --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,23 @@ +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: action/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 c755a5cee434b5931677e9b9b68e7659c26044a2 Mon Sep 17 00:00:00 2001 From: zildirayalfirli Date: Tue, 5 Mar 2024 08:38:42 +0700 Subject: [PATCH 02/11] add case 1 --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 35b5e76c..f7c9e634 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,3 +1,4 @@ + name: Test, Build, and Deploy | Modul 01 - Lab2.2 Senior Project on: From 54151c8a5b501e472a09edbfe07e9895cd1900fd Mon Sep 17 00:00:00 2001 From: zildirayalfirli Date: Tue, 5 Mar 2024 08:43:56 +0700 Subject: [PATCH 03/11] case 1:job and test built --- .github/workflows/main.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f7c9e634..c7603a57 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,11 +14,13 @@ jobs: node-version: [16.x] steps: - - uses: action/checkout@v2 + - 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 + - run: npm run build + + \ No newline at end of file From 01c0f6e232a67bf61ee14f4e2a6e1f9a2d8c1ced Mon Sep 17 00:00:00 2001 From: zildirayalfirli Date: Tue, 5 Mar 2024 08:54:36 +0700 Subject: [PATCH 04/11] case 2 --- .github/workflows/main.yml | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c7603a57..4283018b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -23,4 +23,35 @@ jobs: - run: npm i - 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/vm_senpro_modul2_44 + echo "Cek folder project"; + [ ! -d "${HOME}/senpro/482759/modul02/senpro-github-action/" ] && + { + echo "Repository belum di-clone. Cloning..."; + mkdir -p ~/senpro/482759/modul02; + cd ~/senpro/482759/modul02; + git clone ggit@github.com:zildirayalfirli/senpro-github-action.gitSS; + } || + { + echo "Repository sudah ada. Building..."; + cd ~/senpro/482759/modul02/senpro-github-action; + git restore .; + git pull origin main + } \ No newline at end of file From b234efa2606c5b6895b9392f953031994249156d Mon Sep 17 00:00:00 2001 From: zildirayalfirli Date: Tue, 5 Mar 2024 09:02:49 +0700 Subject: [PATCH 05/11] case 2 --- .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 4283018b..5e7e0cd9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -53,5 +53,5 @@ jobs: echo "Repository sudah ada. Building..."; cd ~/senpro/482759/modul02/senpro-github-action; git restore .; - git pull origin main + git pull origin main; } \ No newline at end of file From 14630e688f00cb2d8f63a07d08c2f55d9e5856cd Mon Sep 17 00:00:00 2001 From: zildirayalfirli Date: Tue, 5 Mar 2024 09:06:43 +0700 Subject: [PATCH 06/11] case 2 --- .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 5e7e0cd9..4194e64c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -47,7 +47,7 @@ jobs: echo "Repository belum di-clone. Cloning..."; mkdir -p ~/senpro/482759/modul02; cd ~/senpro/482759/modul02; - git clone ggit@github.com:zildirayalfirli/senpro-github-action.gitSS; + git clone git@github.com:zildirayalfirli/senpro-github-action.git; } || { echo "Repository sudah ada. Building..."; From 5ce40006c6d7308552b0e85a84c0f60e26eb7c11 Mon Sep 17 00:00:00 2001 From: zildirayalfirli Date: Tue, 5 Mar 2024 09:15:13 +0700 Subject: [PATCH 07/11] case 2 --- .github/workflows/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4194e64c..15358763 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -34,10 +34,10 @@ jobs: - name: Build app on VM uses: appleboy/ssh-action@master with: - host: ${{secrets.HOST}} - username: ${{secrets.USERNAME}} - password: ${{secrets.PASSWORD}} - port: ${{secrets.PORT}} + host: ${{ secrets.HOST }} + username: ${{ secrets.USERNAME }} + password: ${{ secrets.PASSWORD }} + port: ${{ secrets.PORT }} script: | eval "$(ssh-agent -s)" ssh-add ~/.ssh/vm_senpro_modul2_44 From 0264668a9a05eb06432ca9336838fc756027bcac Mon Sep 17 00:00:00 2001 From: zildirayalfirli Date: Tue, 5 Mar 2024 09:25:06 +0700 Subject: [PATCH 08/11] case 3 --- src/pages/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pages/index.js b/src/pages/index.js index ba9f0517..84a7d92a 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -1,7 +1,7 @@ -import Head from 'next/head' -import Image from 'next/image' -import { Inter } from '@next/font/google' -import styles from '@/styles/Home.module.css' +// import Head from 'next/head' +// import Image from 'next/image' +// import { Inter } from '@next/font/google' +// import styles from '@/styles/Home.module.css' const inter = Inter({ subsets: ['latin'] }) @@ -30,7 +30,7 @@ export default function Home() {
- [Nama] | [NIU] + [Zildiray Alfirli] | [482759]
From 44d847bb6b80cd9f05c802ce54f74f93a7a62d76 Mon Sep 17 00:00:00 2001 From: zildirayalfirli Date: Tue, 5 Mar 2024 09:33:51 +0700 Subject: [PATCH 09/11] case 3 --- src/pages/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pages/index.js b/src/pages/index.js index 84a7d92a..ba9f0517 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -1,7 +1,7 @@ -// import Head from 'next/head' -// import Image from 'next/image' -// import { Inter } from '@next/font/google' -// import styles from '@/styles/Home.module.css' +import Head from 'next/head' +import Image from 'next/image' +import { Inter } from '@next/font/google' +import styles from '@/styles/Home.module.css' const inter = Inter({ subsets: ['latin'] }) @@ -30,7 +30,7 @@ export default function Home() {
- [Zildiray Alfirli] | [482759] + [Nama] | [NIU]
From d56ab767cb28cbbb674852bd457c5fe589e353b7 Mon Sep 17 00:00:00 2001 From: zildirayalfirli Date: Tue, 5 Mar 2024 09:40:52 +0700 Subject: [PATCH 10/11] case 3 --- src/pages/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pages/index.js b/src/pages/index.js index ba9f0517..84a7d92a 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -1,7 +1,7 @@ -import Head from 'next/head' -import Image from 'next/image' -import { Inter } from '@next/font/google' -import styles from '@/styles/Home.module.css' +// import Head from 'next/head' +// import Image from 'next/image' +// import { Inter } from '@next/font/google' +// import styles from '@/styles/Home.module.css' const inter = Inter({ subsets: ['latin'] }) @@ -30,7 +30,7 @@ export default function Home() {
- [Nama] | [NIU] + [Zildiray Alfirli] | [482759]
From 8fe94c0b282aefc68ef7359e7712515dfeec3fee Mon Sep 17 00:00:00 2001 From: zildirayalfirli Date: Tue, 5 Mar 2024 09:44:20 +0700 Subject: [PATCH 11/11] case 4 --- src/pages/index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pages/index.js b/src/pages/index.js index 84a7d92a..d0031f5d 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -1,7 +1,7 @@ -// import Head from 'next/head' -// import Image from 'next/image' -// import { Inter } from '@next/font/google' -// import styles from '@/styles/Home.module.css' +import Head from 'next/head' +import Image from 'next/image' +import { Inter } from '@next/font/google' +import styles from '@/styles/Home.module.css' const inter = Inter({ subsets: ['latin'] })