-
Notifications
You must be signed in to change notification settings - Fork 20
107 lines (84 loc) · 2.57 KB
/
build-production.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: "Build and deploy Production"
on:
push:
branches:
- main
schedule:
- cron: "45 */12 * * *"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-production
cancel-in-progress: true
jobs:
build:
name: Build site
runs-on: ubuntu-latest
env:
RENV_PROFILE: "production"
RENV_CONFIG_SANDBOX_ENABLED: FALSE
hugobd: public
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 2
- name: Set env parameters
run: |
ver=$(cat .hugoversion)
echo "hugovr=$ver" >> $GITHUB_ENV
- name: Install cURL Headers
run: |
sudo apt-get update
sudo apt-get install libcurl4-openssl-dev
- name: Setup R
uses: r-lib/actions/setup-r@v2
with:
r-version: '4.3.0'
- name: Serup renv
uses: r-lib/actions/setup-renv@v2
- name: Populate untranslated pages
run: |
Rscript scripts/missing_translations.R
- name: Site data - Clean folders
run: rm -r data/directory data/rblogs
- name: Site data - DIRECTORY - Get
uses: actions/checkout@v4
with:
repository: rladies/directory
ssh-key: ${{ secrets.ssh_directoryy_repo }}
path: tmpd/dir
- name: Site data - DIRECTORY - Move
run: |
cp -r tmpd/dir/data/json data/directory
cp -r tmpd/dir/data/img/* assets/directory
- name: Site data - Meetup
uses: actions/checkout@v4
with:
repository: rladies/meetup_archive
ssh-key: ${{ secrets.MEETUP_ARCHIVE_KEY}}
path: tmpd/mtp
- name: Site data - Get blogs list
uses: actions/checkout@v4
with:
repository: rladies/awesome-rladies-blogs
ssh-key: ${{ secrets.RLADIES_BLOGS_KEY}}
path: tmpd/rblogs
- name: Site data - clean cloned repos
run: |
cp -r tmpd/rblogs/blogs data/rblogs
cp -r tmpd/mtp/data/* data/meetup/
rm -rf tmpd
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: ${{ env.hugovr }}
extended: true
- name: Build
run: |
hugo \
-e production \
-d ${{ env.hugobd }}
- name: Deploy production 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: ${{ env.hugobd }}