From fa05d434e62b9a749fb458b3b6c3208fc95a7aa6 Mon Sep 17 00:00:00 2001 From: xwidyav1 Date: Fri, 14 Feb 2025 09:25:50 +0700 Subject: [PATCH 1/6] scrt --- public/github/workflows/main.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 public/github/workflows/main.yml diff --git a/public/github/workflows/main.yml b/public/github/workflows/main.yml new file mode 100644 index 00000000..2294b4b3 --- /dev/null +++ b/public/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: 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 ed49e3726ff7eac36da2f8120900feaf166cc3db Mon Sep 17 00:00:00 2001 From: xwidyav1 Date: Fri, 14 Feb 2025 09:31:56 +0700 Subject: [PATCH 2/6] new --- public/{github => .github}/workflows/main.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename public/{github => .github}/workflows/main.yml (100%) diff --git a/public/github/workflows/main.yml b/public/.github/workflows/main.yml similarity index 100% rename from public/github/workflows/main.yml rename to public/.github/workflows/main.yml From 86cacf63b9e6f49f146ca4ad6840e7a25c93a73b Mon Sep 17 00:00:00 2001 From: xwidyav1 Date: Fri, 14 Feb 2025 09:35:54 +0700 Subject: [PATCH 3/6] nes --- {public/.github => .github}/workflows/main.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {public/.github => .github}/workflows/main.yml (100%) diff --git a/public/.github/workflows/main.yml b/.github/workflows/main.yml similarity index 100% rename from public/.github/workflows/main.yml rename to .github/workflows/main.yml From b7e0ce32123515fa4c058dd3df25060e928e50e8 Mon Sep 17 00:00:00 2001 From: xwidyav1 Date: Fri, 14 Feb 2025 10:10:20 +0700 Subject: [PATCH 4/6] nambah niu --- .github/workflows/main.yml | 45 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2294b4b3..004e2796 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -name : Test, Build, and Deploy | Modul 01 - Lab2.2 Senior Project +name: Test, Build, and Deploy | Modul 01 - Lab2.2 Senior Project on: push: @@ -20,4 +20,45 @@ 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-praktikan29 + echo "Cek folder project"; + [ ! -d "${HOME}/senpro/503741/modul02/senpro-github-action/" ] && + { + echo "Repository belum di-clone. Cloning..."; + mkdir -p ~/senpro/503741/modul02; + cd ~/senpro/503741/modul02; + git clone https://github.com/xwidyav1/senpro-github-action.git; + cd ~/senpro/503741/modul02/senpro-github-action; + echo "Install Package dan Build Project"; + npm install; + npm run build; + } || + { + echo "Repository sudah ada. Building..."; + cd ~/senpro/503741/modul02/senpro-github-action; + git restore .; + git pull origin main; + echo "Install Package dan Build Project"; + npm install; + npm run build; + } \ No newline at end of file From 68e4cf4ee98d9bbfdbd16272bdaa7dfee7ab3172 Mon Sep 17 00:00:00 2001 From: xwidyav1 Date: Fri, 14 Feb 2025 10:17:32 +0700 Subject: [PATCH 5/6] nekok --- 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..d8314bf4 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] + [Pijar] | [503741]
From 6ba63daab43661cacb6e1345addc9f0747b39466 Mon Sep 17 00:00:00 2001 From: xwidyav1 Date: Fri, 14 Feb 2025 10:25:21 +0700 Subject: [PATCH 6/6] nekok --- 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 d8314bf4..c6d4c191 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'] })