-
Notifications
You must be signed in to change notification settings - Fork 4
52 lines (46 loc) · 1.73 KB
/
publish.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
name: Push mainline branch to public repo
on:
push:
branches:
- mainline
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ env.GITHUB_REF_NAME }}
- uses: actions/cache@v4
with:
path: vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile') }}
restore-keys: |
${{ runner.os }}-gems-
- uses: ruby/setup-ruby@b256bd96bb4867e7d23e92e087d9bb697270b725 # v1.163.0
with:
ruby-version: '3.3'
bundler-cache: true
- name: Write JSON secret to file
run: echo -n "${{ secrets.ENGINEERING_JSON }}" | base64 --decode > hot-topic/engineering-173019-49cb92815171.json
- name: Build and run google-analytics-script Docker image
run: |
docker build -t google-analytics-script -f hot-topic/Dockerfile ./hot-topic
docker run -v $(pwd)/hot-topic/engineering-173019-49cb92815171.json:/app/engineering-173019-49cb92815171.json \
-v $(pwd)/README.md:/app/README.md \
google-analytics-script
- name: Sanity build site
run: JEKYLL_ENV=preview LC_ALL=C.UTF-8 bundle exec jekyll build -d prod
- name: Prepare SSH key
run: |
echo "${{ secrets.DOCS_PUBLISH_KEY }}" > /tmp/key
chmod 400 /tmp/key
- name: Push to remote gh-pages branch
run: |
git remote add -t ${GITHUB_REF_NAME} -m gh-pages public [email protected]:Qumulo/docs
git push --set-upstream public ${GITHUB_REF_NAME}:gh-pages
env:
GIT_SSH_COMMAND: ssh -i /tmp/key
- name: Clean up SSH key
run: |
rm -f /tmp/key