forked from eliascotto/tryclojure
-
Notifications
You must be signed in to change notification settings - Fork 1
69 lines (60 loc) · 2.01 KB
/
deploy.yaml
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Build and deploy GH Pages
## ref: https://github.com/marketplace/actions/setup-clojure
## ref: https://github.com/actions/setup-node
on:
push:
branches:
- translate-kr
jobs:
build:
name: Publish site
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: Prepare java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '8'
- name: Install clojure tools
uses: DeLaGuardo/[email protected]
with:
cli: 1.11.1.1413
- name: Cache clojure dependencies
uses: actions/cache@v3
with:
path: |
~/.m2/repository
~/.gitlibs
~/.deps.clj
# List all files containing dependencies:
key: cljdeps-${{ hashFiles('deps.edn') }}
# key: cljdeps-${{ hashFiles('deps.edn', 'bb.edn') }}
# key: cljdeps-${{ hashFiles('project.clj') }}
# key: cljdeps-${{ hashFiles('build.boot') }}
restore-keys: cljdeps-
- name: setup_npm
uses: actions/setup-node@v4
with:
node-version: 18
cache: 'npm'
- name: build_and_deploy
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
GITHUB_HOSTNAME="github.com"
TARGET_REPOSITORY=${GITHUB_REPOSITORY}
remote_repo="https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@${GITHUB_HOSTNAME}/${TARGET_REPOSITORY}.git"
remote_branch="gh-pages"
npm install
npm run build
echo "Pushing artifacts to ${TARGET_REPOSITORY}:$remote_branch"
cd resources/public
git init
git config user.name "GitHub Actions"
git config user.email "[email protected].${GITHUB_HOSTNAME}"
git add .
git commit -m "Deploy ${TARGET_REPOSITORY} to ${TARGET_REPOSITORY}:$remote_branch"
git push --force "${remote_repo}" master:"${remote_branch}"
echo "Deploy complete"