-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (53 loc) · 1.61 KB
/
ci.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
# Copyright (c) 2023 Paul Barker <paul@pbarker.dev>
# SPDX-License-Identifier: Apache-2.0
name: Build website
on: [push, pull_request]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Setup Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "pip"
- name: Install dependencies
run: pip install -r requirements.txt
- name: Install Tailwind CSS
run: |
wget "https://github.com/tailwindlabs/tailwindcss/releases/download/v3.4.1/tailwindcss-linux-x64" -O /usr/local/bin/tailwindcss
chmod a+x /usr/local/bin/tailwindcss
- name: Build website with Pelican
run: |
if [[ $GITHUB_REF == 'refs/heads/main' ]]; then
inv build --prod
else
inv build
fi
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: public
path: public
deploy:
name: Deploy
needs: build
if: github.repository == 'unnecessary-abstraction/pbarker.dev'
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: public
path: public
- name: Deploy to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: pbarker
directory: public
branch: ${{ github.ref_name }}