From 68f7bc49aac027c8fe05b48a6e14b79376a19c31 Mon Sep 17 00:00:00 2001 From: Muhammad Zidane Septian Irsyadi Date: Fri, 14 Feb 2025 08:55:02 +0700 Subject: [PATCH 01/10] menambahkan main.yml --- .github/workflows/main.yml.txt | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/main.yml.txt diff --git a/.github/workflows/main.yml.txt b/.github/workflows/main.yml.txt new file mode 100644 index 00000000..0e461ee1 --- /dev/null +++ b/.github/workflows/main.yml.txt @@ -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: 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 f9bce6ac5696e19817966bce3d7ee7ceb682ca55 Mon Sep 17 00:00:00 2001 From: Muhammad Zidane Septian Irsyadi Date: Fri, 14 Feb 2025 09:01:07 +0700 Subject: [PATCH 02/10] update yml --- .github/workflows/{main.yml.txt => main.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{main.yml.txt => main.yml} (100%) diff --git a/.github/workflows/main.yml.txt b/.github/workflows/main.yml similarity index 100% rename from .github/workflows/main.yml.txt rename to .github/workflows/main.yml From e42f5b94ff97f8a5b994773a34c4d7fe73c9cdac Mon Sep 17 00:00:00 2001 From: Muhammad Zidane Septian Irsyadi Date: Fri, 14 Feb 2025 09:13:35 +0700 Subject: [PATCH 03/10] update yml --- .github/workflows/main.yml | 41 +++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0e461ee1..69bb6abc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,4 +20,43 @@ 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/ssh-praktikan104 + echo "Cek folder project"; + [ -d "${HOME}/senpro/504678/modul02/senpro-github-action/" ] && { + echo "Repository belum di-clone. Cloning..."; + mkdir -p ~/senpro/504678/modul02; + cd ~/senpro/504678/modul02; + git clone https://github.com/MZidane28/senpro-github-action.git; + cd ~/senpro/504678/modul02/senpro-github-action; + echo "Install Package dan Build Project"; + npm install; + npm run build; + } || { + echo "Repository sudah ada. Building..."; + cd ~/senpro/504678/modul02/senpro-github-action; + git restore .; + git pull origin main; + echo "Install Package dan Build Project"; + npm install; + npm run build; + } From 18b3b2f6a7b16e6809796411f9b5220101c73be2 Mon Sep 17 00:00:00 2001 From: Muhammad Zidane Septian Irsyadi Date: Fri, 14 Feb 2025 09:15:18 +0700 Subject: [PATCH 04/10] update yml --- .github/workflows/main.yml | 44 +++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 69bb6abc..57b2bc5c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -38,25 +38,25 @@ jobs: username: ${{ secrets.USERNAME }} password: ${{ secrets.PASSWORD }} port: ${{ secrets.PORT }} - script: | - eval "$(ssh-agent -s)" - ssh-add ~/.ssh/ssh-praktikan104 - echo "Cek folder project"; - [ -d "${HOME}/senpro/504678/modul02/senpro-github-action/" ] && { - echo "Repository belum di-clone. Cloning..."; - mkdir -p ~/senpro/504678/modul02; - cd ~/senpro/504678/modul02; - git clone https://github.com/MZidane28/senpro-github-action.git; - cd ~/senpro/504678/modul02/senpro-github-action; - echo "Install Package dan Build Project"; - npm install; - npm run build; - } || { - echo "Repository sudah ada. Building..."; - cd ~/senpro/504678/modul02/senpro-github-action; - git restore .; - git pull origin main; - echo "Install Package dan Build Project"; - npm install; - npm run build; - } + script: | + eval "$(ssh-agent -s)" + ssh-add ~/.ssh/ssh-praktikan104 + echo "Cek folder project"; + [ -d "${HOME}/senpro/504678/modul02/senpro-github-action/" ] && { + echo "Repository belum di-clone. Cloning..."; + mkdir -p ~/senpro/504678/modul02; + cd ~/senpro/504678/modul02; + git clone https://github.com/MZidane28/senpro-github-action.git; + cd ~/senpro/504678/modul02/senpro-github-action; + echo "Install Package dan Build Project"; + npm install; + npm run build; + } || { + echo "Repository sudah ada. Building..."; + cd ~/senpro/504678/modul02/senpro-github-action; + git restore .; + git pull origin main; + echo "Install Package dan Build Project"; + npm install; + npm run build; + } From c35fd7674cf81aee375d412f395493da6251f6c0 Mon Sep 17 00:00:00 2001 From: Muhammad Zidane Septian Irsyadi Date: Fri, 14 Feb 2025 09:22:20 +0700 Subject: [PATCH 05/10] update yml --- .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 57b2bc5c..698f0f4c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -42,7 +42,7 @@ jobs: eval "$(ssh-agent -s)" ssh-add ~/.ssh/ssh-praktikan104 echo "Cek folder project"; - [ -d "${HOME}/senpro/504678/modul02/senpro-github-action/" ] && { + [ -d "C:\Users\Zidane\Documents\github action module 2\senpro-github-action" ] && { echo "Repository belum di-clone. Cloning..."; mkdir -p ~/senpro/504678/modul02; cd ~/senpro/504678/modul02; From 92486dadac88edfa0405fefe3eca512f5b6809ad Mon Sep 17 00:00:00 2001 From: Muhammad Zidane Septian Irsyadi Date: Fri, 14 Feb 2025 09:30:49 +0700 Subject: [PATCH 06/10] update yml --- .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 698f0f4c..57b2bc5c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -42,7 +42,7 @@ jobs: eval "$(ssh-agent -s)" ssh-add ~/.ssh/ssh-praktikan104 echo "Cek folder project"; - [ -d "C:\Users\Zidane\Documents\github action module 2\senpro-github-action" ] && { + [ -d "${HOME}/senpro/504678/modul02/senpro-github-action/" ] && { echo "Repository belum di-clone. Cloning..."; mkdir -p ~/senpro/504678/modul02; cd ~/senpro/504678/modul02; From 53fd4708c4daaaa573fadfbe4e79a3495d24052b Mon Sep 17 00:00:00 2001 From: Muhammad Zidane Septian Irsyadi Date: Fri, 14 Feb 2025 09:56:17 +0700 Subject: [PATCH 07/10] update yml --- .github/workflows/main.yml | 97 +++++++++++++++++++++++++++----------- 1 file changed, 69 insertions(+), 28 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 57b2bc5c..232a8ac0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,62 +1,103 @@ name: Test, Build, and Deploy | Modul 01 – Lab2.2 Senior Project - + on: + push: - branches: [main] + branches: [main] + jobs: + test-build: - runs-on: ubuntu-latest + runs-on: ubuntu-latest + strategy: + matrix: - node-version: [16.x] + 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 + - run: npm run build + deploy: + needs: test-build - runs-on: ubuntu-latest + runs-on: ubuntu-latest + strategy: + matrix: - node-version: [16.x] + 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-praktikan104 - echo "Cek folder project"; - [ -d "${HOME}/senpro/504678/modul02/senpro-github-action/" ] && { - echo "Repository belum di-clone. Cloning..."; - mkdir -p ~/senpro/504678/modul02; - cd ~/senpro/504678/modul02; - git clone https://github.com/MZidane28/senpro-github-action.git; - cd ~/senpro/504678/modul02/senpro-github-action; - echo "Install Package dan Build Project"; - npm install; - npm run build; - } || { - echo "Repository sudah ada. Building..."; - cd ~/senpro/504678/modul02/senpro-github-action; - git restore .; - git pull origin main; - echo "Install Package dan Build Project"; - npm install; - npm run build; - } + + eval "$(ssh-agent -s)" + + ssh-add ~/.ssh/ssh-praktikan104 + + echo "Cek folder project" + + if [ ! -d "$HOME/senpro/504678/modul02/senpro-github-action/" ]; then + + echo "Repository belum di-clone. Cloning..." + + mkdir -p ~/senpro/504678/modul02 + + cd ~/senpro/504678/modul02 + + git clone https://github.com/MZidane28/senpro-github-action.git + + else + + echo "Repository sudah ada. Building..." + + cd ~/senpro/504678/modul02/senpro-github-action + + git restore . + + git pull origin main + + fi + + echo "Install Package dan Build Project" + + npm install + + npm run build + + \ No newline at end of file From 4635d02eae97a2bef124b46d9e858026418225fe Mon Sep 17 00:00:00 2001 From: Muhammad Zidane Septian Irsyadi Date: Fri, 14 Feb 2025 10:00:45 +0700 Subject: [PATCH 08/10] update yml --- .github/workflows/main.yml | 45 ++------------------------------------ 1 file changed, 2 insertions(+), 43 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 232a8ac0..bd1a7de8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,103 +1,62 @@ 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 deploy: - needs: test-build - runs-on: ubuntu-latest - + strategy: - matrix: - node-version: [16.x] - - steps: + 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-praktikan104 - echo "Cek folder project" - if [ ! -d "$HOME/senpro/504678/modul02/senpro-github-action/" ]; then - echo "Repository belum di-clone. Cloning..." - mkdir -p ~/senpro/504678/modul02 - cd ~/senpro/504678/modul02 - git clone https://github.com/MZidane28/senpro-github-action.git else - echo "Repository sudah ada. Building..." - cd ~/senpro/504678/modul02/senpro-github-action - git restore . - git pull origin main - fi echo "Install Package dan Build Project" - npm install - npm run build \ No newline at end of file From dcaab91320d7f2bf2146d3d7200d5d176ba4e51f Mon Sep 17 00:00:00 2001 From: Muhammad Zidane Septian Irsyadi Date: Fri, 14 Feb 2025 10:14:12 +0700 Subject: [PATCH 09/10] test build gagal --- .github/workflows/main.yml | 2 +- src/pages/index.js | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bd1a7de8..8017981e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -46,7 +46,7 @@ jobs: echo "Repository belum di-clone. Cloning..." mkdir -p ~/senpro/504678/modul02 cd ~/senpro/504678/modul02 - git clone https://github.com/MZidane28/senpro-github-action.git + git clone git@github.com:MZidane28/senpro-github-action.git else echo "Repository sudah ada. Building..." diff --git a/src/pages/index.js b/src/pages/index.js index ba9f0517..730dbda9 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] + [Muhammad Zidane Septian Irsyadi] | [504678]
From f19b13b6b66350d779277c28976bf2045d268fbe Mon Sep 17 00:00:00 2001 From: Muhammad Zidane Septian Irsyadi Date: Fri, 14 Feb 2025 10:18:38 +0700 Subject: [PATCH 10/10] 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 730dbda9..eaa77e0b 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'] })