-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (47 loc) · 1.38 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
49
50
name: CI
on: [push, pull_request]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v30
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
- uses: cachix/cachix-action@v15
with:
name: yuanw-blog
signingKey: ${{ secrets.CACHIX_SIGNING_KEY }}
- name: Nix build
run: nix build
# NOTE Workaround for artifacts and deploy not liking symlinks to
# read-only paths.
- name: "Copy artifacts"
run: "mkdir dist && cp -r result/* dist/ && chmod +w -R dist/"
- name: Archive Production Artifact
uses: actions/upload-artifact@master
with:
name: dist
path: dist
deploy:
name: Deploy
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Download Artifact
uses: actions/download-artifact@master
with:
name: dist
path: dist
- name: Deploy to Firebase
uses: w9jds/[email protected]
with:
args: deploy --message '${{github.event.head_commit.message}}' --only hosting
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
PROJECT_ID: ${{secrets.FIREBASE_PROJECT_ID}}