-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (33 loc) · 1.04 KB
/
build.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
40
name: Build Website
on:
push:
branches: ["main"]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js 14.x
uses: actions/setup-node@v3
with:
node-version: 14.x
- name: Build website
run: yarn && yarn build
- name: Prepare branch for deployment
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
find ./ -maxdepth 1 ! -name "dist" ! -name ".git" ! -name "." -exec rm -rf {} \; && \
mv dist/* . && \
rm -rf dist && \
echo "guvendegirmenci.com" > CNAME && \
git config --local user.name "github-actions[bot]" && \
git config --local user.email "github-actions[bot]@users.noreply.github.com" && \
git add . && \
git commit -m "Deploy to GitHub Pages"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: gh-pages
force: true