-
Notifications
You must be signed in to change notification settings - Fork 29
51 lines (44 loc) · 1.74 KB
/
deploy.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
41
42
43
44
45
46
47
48
49
50
51
name: Hugo Staging Deploy
on:
# pull_request:
# types: [review_requested]
issue_comment:
types: [created, edited]
jobs:
deploy_staging:
if: ${{ github.event.issue.pull_request && github.event.requested_team.name == 'hackers' && contains(github.event.comment.body, '/staging') }}
runs-on: ubuntu-22.04
environment: stagingdeploy
steps:
- name: Checkout PR branch
uses: actions/checkout@v4
with:
submodules: recursive # Fetch Hugo themes (true OR recursive)
fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod
lfs: true # Fetch Git LFS files
ref: refs/pull/${{ github.event.issue.number }}/head
- name: Setup Hugo
uses: peaceiris/actions-hugo@v3
with:
hugo-version: '0.97.0'
extended: true
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- name: Install dependencies (postcss), bootstrap-sass
run: npm install --save-dev autoprefixer && npm install postcss-cli && npm install -D postcss && npm install -D postcss-preset-env && npm install -D bootstrap-sass
- name: Build
run: cd kernelci.org;hugo --minify -D -F -b https://static.staging.kernelci.org/
- name: Deploy via SCP
uses: appleboy/[email protected]
with:
host: ${{ secrets.WEB_STAGING_HOST }}
username: ${{ secrets.WEB_STAGING_USERNAME }}
key: ${{ secrets.WEB_STAGING_KEY }}
port: ${{ secrets.WEB_STAGING_PORT }}
source: "kernelci.org/public/"
target: ${{ secrets.WEB_STAGING_DIR }}
strip_components: 2