Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
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:
- 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;
}


2 changes: 1 addition & 1 deletion src/pages/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default function Home() {

<div>
<h5 className={inter.className}>
[Nama] | [NIU]
[Rasyid Baskoro Agung] | [456850]
</h5>
</div>
</main>
Expand Down