-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (37 loc) · 1.25 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Deployment Web
on:
workflow_dispatch:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install Dependencies
run: npm install
- name: Build & Complie
run: npm run build
- name: Rebuild Algolia index records
run: ALGOLIA_APP_ID=${{secrets.ALGOLIA_APP_ID}} ALGOLIA_API_KEY=${{secrets.ALGOLIA_API_KEY}} node ./bin/generateArticleJSON.js
- name: Clone Production Repo & Update
run: |
git clone https://munirapp:${{secrets.TOKEN_GITHUB}}@github.com/munirapp/munirapp.github.io
rm -rf munirapp.github.io/*
cp -r ./dist/* munirapp.github.io/
touch munirapp.github.io/.nojekyll
- name: Deploy to Production Repo
run: |
git config --global user.email "[email protected]"
git config --global user.name "Munir AP"
git add .
git commit --allow-empty -m "update"
git push origin main
working-directory: ./munirapp.github.io