-
Notifications
You must be signed in to change notification settings - Fork 45
72 lines (59 loc) · 1.85 KB
/
deploy-website.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
name: Deploy website
on: workflow_dispatch
concurrency:
group: docs-website
env:
JEKYLL_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
deploy:
name: Cloudflare Pages
runs-on: ubuntu-latest
environment:
name: stockindicators.dev
url: https://python.stockindicators.dev
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
working-directory: docs
ruby-version: 3.3
- name: Define tag
id: tag
run: echo "version=$(date +'%Y.%m.%d')-${{ github.run_number }}" >> $GITHUB_OUTPUT
- name: Replace cache markers
uses: jacobtomlinson/gha-find-replace@v3
with:
find: "YYYY.MM.DD"
replace: "${{ steps.tag.outputs.version }}"
regex: false
- name: Install GEMs
working-directory: docs
env:
BUNDLE_GEMFILE: ${{github.workspace}}/docs/GemFile
run: |
pwd
bundle install
- name: Build site (production)
if: github.ref == 'refs/heads/main'
working-directory: docs
env:
JEKYLL_ENV: production
BUNDLE_GEMFILE: ${{github.workspace}}/docs/GemFile
run: bundle exec jekyll build
- name: Build site (preview)
if: github.ref != 'refs/heads/main'
working-directory: docs
env:
JEKYLL_ENV: preview
BUNDLE_GEMFILE: ${{github.workspace}}/docs/GemFile
run: bundle exec jekyll build
- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_KEY }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: ${{ vars.CLOUDFLARE_PROJECT_NAME }}
directory: docs/_site
wranglerVersion: 'latest'