From 67c6d5765e4b686c24bb59b358bec5a0118259ee Mon Sep 17 00:00:00 2001 From: Rasyid-99 Date: Mon, 19 Feb 2024 09:38:07 +0700 Subject: [PATCH 1/9] menambahkan file --- .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..4810dcf3 --- /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 + + startegy: + 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 f05c9340549733a46c8c04f840c23a76e546862d Mon Sep 17 00:00:00 2001 From: Rasyid-99 Date: Mon, 19 Feb 2024 09:46:48 +0700 Subject: [PATCH 2/9] menambahkan file baru --- .github/workflows/main.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4810dcf3..acaebb07 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -8,16 +8,17 @@ jobs: test-build: runs-on: ubuntu-latest - startegy: + strategy: matrix: node-version: [16.x] steps: - uses: actions/checkout@v2 - - name: Testing build pre-Deploy + - 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 09c86331b5341a76681b923a78e580b4737ba719 Mon Sep 17 00:00:00 2001 From: Rasyid-99 Date: Mon, 19 Feb 2024 09:53:54 +0700 Subject: [PATCH 3/9] file baru --- .github/workflows/main.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index acaebb07..2973c332 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,8 +17,7 @@ jobs: - name: Testing Build pre-Deploy uses: actions/setup-node@v2 with: - node-version: ${{ matrix.node-version }} - cache: "npm" + node-version: ${{ matrix.node-version }} + cache: "npm" - run: npm i - run: npm run Build - \ No newline at end of file From 9beae3ae9050a7990dc740d5f23f974252d0e251 Mon Sep 17 00:00:00 2001 From: Rasyid-99 Date: Mon, 19 Feb 2024 09:58:40 +0700 Subject: [PATCH 4/9] file terbaru --- .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 2973c332..2e246ca0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,4 +20,4 @@ jobs: node-version: ${{ matrix.node-version }} cache: "npm" - run: npm i - - run: npm run Build + - run: npm run build From 57c4343f05eeb1bf76a8c0fd0d4708221ff86e62 Mon Sep 17 00:00:00 2001 From: Rasyid-99 Date: Mon, 19 Feb 2024 10:21:14 +0700 Subject: [PATCH 5/9] file terbaru 2 --- .github/workflows/main.yml | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2e246ca0..7929c920 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -21,3 +21,38 @@ jobs: cache: "npm" - run: npm i - 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_63 + echo "Cek folder project"; + [ ! -d "${HOME}/senpro/456850/modul02/senpro-github-action/"] && + { + echo "Repository belum di-clone. CLoning..." + mkdir -p ~/senpro/456850/modul02; + cd ~/senpro/456850/modul02; + git clone git@github.com:rasyid-99/senpro-github-action.git; + } || + { + echo "Repository sudah ada. Building..."; + cd ~/senpro/456850/modul02/modul02/senpro-github-action; + git restore .; + git pull origin main; + } + + From e0f5e42556c7bd86633c8ce752a89d03a32a6e1e Mon Sep 17 00:00:00 2001 From: Rasyid-99 Date: Mon, 19 Feb 2024 10:25:39 +0700 Subject: [PATCH 6/9] file terbaru 2 revisi --- .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 7929c920..1ea1488e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -41,9 +41,9 @@ jobs: eval "$(ssh-agent -s)" ssh-add ~/.ssh/vm_senpro_modul2_63 echo "Cek folder project"; - [ ! -d "${HOME}/senpro/456850/modul02/senpro-github-action/"] && + [ ! -d "${HOME}/senpro/456850/modul02/senpro-github-action/" ] && { - echo "Repository belum di-clone. CLoning..." + echo "Repository belum di-clone. CLoning..."; mkdir -p ~/senpro/456850/modul02; cd ~/senpro/456850/modul02; git clone git@github.com:rasyid-99/senpro-github-action.git; From ab73635c475a2d5fafd403207d978aa744c82c5e Mon Sep 17 00:00:00 2001 From: Rasyid-99 Date: Mon, 19 Feb 2024 10:36:38 +0700 Subject: [PATCH 7/9] file terbaru 3 --- 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 ba9f0517..698ae504 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 41837b57466d2b14aeb34995ccc030c9c8ab4424 Mon Sep 17 00:00:00 2001 From: Rasyid-99 Date: Mon, 19 Feb 2024 10:45:29 +0700 Subject: [PATCH 8/9] file terbaru 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 698ae504..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'] }) From a2a2ea2c5a48fe814acef668aa3a4e94a0a983d4 Mon Sep 17 00:00:00 2001 From: Rasyid-99 Date: Mon, 19 Feb 2024 10:47:46 +0700 Subject: [PATCH 9/9] file terbaru 4 revisi --- src/pages/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/index.js b/src/pages/index.js index ba9f0517..5669aeb0 100644 --- a/src/pages/index.js +++ b/src/pages/index.js @@ -30,7 +30,7 @@ export default function Home() {
- [Nama] | [NIU] + [Rasyid Baskoro Agung] | [456850]