From 3fd3185c9192a50bfb8dd9340d72d955a3adb7ba Mon Sep 17 00:00:00 2001 From: ricofrijayaspane Date: Tue, 5 Mar 2024 07:55:33 +0700 Subject: [PATCH 1/9] create job 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..fd25df84 --- /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 4aeca1e1002896aaa66a3b1d87a20b54add10515 Mon Sep 17 00:00:00 2001 From: ricofrijayaspane Date: Tue, 5 Mar 2024 07:58:48 +0700 Subject: [PATCH 2/9] create jobs Test Build --- .github/workflows/main.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fd25df84..12027349 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,11 +15,10 @@ jobs: steps: - uses: actions/checkout@v2 - name: Testing Build pre-Deploy - uses: actions/setup-node@v2 - with: - node-version: ${{ matrix.node-version }} - cache: "npm" + 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 ac44a6252eebc07a431acaac3c7ea180225100bb Mon Sep 17 00:00:00 2001 From: ricofrijayaspane Date: Tue, 5 Mar 2024 08:07:07 +0700 Subject: [PATCH 3/9] create jobs Test Build --- .github/workflows/main.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 12027349..b0af080f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,8 +1,8 @@ -name: Test, Build and Deploy | Modul 01 - Lab2.2 Senior Project +name : Test, Build, and Deploy | Modul 01 - Lab2.2 Sebior Project on: push: - branches: [main] + branches: [main] jobs: test-build: @@ -11,14 +11,13 @@ jobs: strategy: matrix: node-version: [16.x] - + steps: - - uses: actions/checkout@v2 + - 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 - + - run: npm run build \ No newline at end of file From 3bcae0d42dc77d98f8de58562cafa7e134077745 Mon Sep 17 00:00:00 2001 From: ricofrijayaspane Date: Tue, 5 Mar 2024 08:09:07 +0700 Subject: [PATCH 4/9] create jobs Test Build --- .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 b0af080f..c00b0817 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,7 @@ 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: From 25ddc5955e583f9b4e7c82dda9274a27e877d428 Mon Sep 17 00:00:00 2001 From: ricofrijayaspane Date: Tue, 5 Mar 2024 08:24:40 +0700 Subject: [PATCH 5/9] create jobs Terhubung ke VM --- .github/workflows/main.yml | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c00b0817..993b94af 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,4 +20,36 @@ jobs: node-version: ${{ matrix.node-version }} cache: "npm" - run: npm i - - run: npm run build \ No newline at end of file + - 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 + with: + host: ${{ secrets.HOST }} + username: ${{ secrets.USERNAME}} + password: ${{ secrets.PASSWORD}} + port: ${{ secrets.PORT}} + script: | + eval "$(ssh-agent -s)" + ssh-add ~/.ssh/vm_senpro_modul2_38 + echo "Cek folder project"; + [ ! -d "${HOME}/senpro/480631/modul02/senpro-github-action/" ] && + { + echo "Repository belum di-clone. Cloning..."; + mkdir -p ~/senpro/480631/modul02; + cd ~/senpro/480631/modul02; + git clone git@github.com:ricofrijayaspane/senpro-github-action.git; + } || + { + echo "Repository sudah ada. Building..."; + cd ~/senpro/480631/modul02/senpro-github-action; + git restore .; + git pull origin main; + } From 4a0f9dde075bb536e14ff4806c5c761638a8061e Mon Sep 17 00:00:00 2001 From: ricofrijayaspane Date: Tue, 5 Mar 2024 08:31:31 +0700 Subject: [PATCH 6/9] create jobs Test Build Gagal --- 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..eaad57a8 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] + [Rico Frijaya S. Pane] | [480631]
From 63f81402818203471cc0c19533a3d8c5ae49b175 Mon Sep 17 00:00:00 2001 From: ricofrijayaspane Date: Tue, 5 Mar 2024 08:34:46 +0700 Subject: [PATCH 7/9] create jobs Perbaikan Build Error --- 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 eaad57a8..6d299a93 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'] }) From b502c29999b8c0334cda4c9787a8b0f4a4df2375 Mon Sep 17 00:00:00 2001 From: ricofrijayaspane Date: Tue, 5 Mar 2024 08:38:56 +0700 Subject: [PATCH 8/9] tes --- 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 6d299a93..eaad57a8 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'] }) From 6a682ce44516cb4044ab0e53bc153da19da047c8 Mon Sep 17 00:00:00 2001 From: ricofrijayaspane Date: Tue, 5 Mar 2024 08:40:34 +0700 Subject: [PATCH 9/9] create jobs Perbaikan Build Error --- 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 eaad57a8..6d299a93 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'] })