-
Notifications
You must be signed in to change notification settings - Fork 1
82 lines (68 loc) · 2.2 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
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
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Deploy
on:
push:
branches:
- master
env:
JEKYLL_VERSION: 3.8
JEKYLL_ENV: production
TZ: Asia/Tokyo
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: "0"
submodules: "true"
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2.2"
- uses: actions/cache@v4
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-gems-
- name: Bundle install
run: |
gem install bundler:2.5.4
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- run: ./scripts/apply_git_log_as_lastmodified_date.sh
- name: Build HTML
run: |
bundle exec jekyll build --config _config.yml
- name: Verify URL in HTML
continue-on-error: true
run: |
bundle exec htmlproofer --enforce_https false --ignore-status-codes "400,999" --ignore-urls "/#.*/,/tofuconf.club/.*/,/twitter.com/,/t.co/,/www.facebook.com/sharer/sharer.php.*/,/www.kyash.co/" ./_site
- name: Prepare SSH 1
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Prepare SSH 2
run: |
mkdir -p ~/.ssh && touch ~/.ssh/config
echo -e "Host tofuconf.club\n\tIdentityFile ~/.ssh/id_rsa\n\tPort 22001\n" >> ~/.ssh/config
ssh-keyscan -H tofuconf.club >> ~/.ssh/known_hosts
- name: Start deployment
uses: bobheadxi/[email protected]
id: deployment
with:
step: start
token: ${{ secrets.GITHUB_TOKEN }}
env: release
- name: Deploy
run: |
bash ./scripts/deploy.sh
- name: Update deployment status
uses: bobheadxi/[email protected]
if: always()
with:
step: finish
token: ${{ secrets.GITHUB_TOKEN }}
status: ${{ job.status }}
env: ${{ steps.deployment.outputs.env }}
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
env_url: https://tofuconf.club