-
Notifications
You must be signed in to change notification settings - Fork 3
48 lines (41 loc) · 1.32 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
name: Site
on:
push:
branches: [main]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Fetch Github Release Asset
uses: dsaltares/[email protected]
with:
repo: cobalt-org/cobalt.rs
file: cobalt-v0.19.2-x86_64-unknown-linux-gnu.tar.gz
token: ${{ secrets.GITHUB_TOKEN }}
- name: Generate _data/env.json
run: |
echo '{
"AIRTABLE_API_KEY": "${AIRTABLE_API_KEY}",
"AIRTABLE_BASE_ID": "${AIRTABLE_BASE_ID}",
"AIRTABLE_TABLE_ID": "${AIRTABLE_TABLE_ID}"
}' > _data/env.json
env:
AIRTABLE_API_KEY: ${{ vars.AIRTABLE_API_KEY }}
AIRTABLE_BASE_ID: ${{ vars.AIRTABLE_BASE_ID }}
AIRTABLE_TABLE_ID: ${{ vars.AIRTABLE_TABLE_ID }}
- name: Build site
run: |
tar xfv cobalt-*
rm -rf doc
./cobalt build
- name: Publish Cloudflare
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: website
directory: _site
gitHubToken: ${{ secrets.GITHUB_TOKEN }}