-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (86 loc) · 2.49 KB
/
deploy.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: Catalyst Voices Updates
on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened, edited]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
pages: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Dart
uses: dart-lang/setup-dart@v1
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Cache Dart packages
uses: actions/cache@v3
with:
path: ~/.pub-cache
key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.lock') }}
restore-keys: |
${{ runner.os }}-pub-
- name: Install dependencies
run: dart pub get
- name: Compile Sass files
run: dart bin/main.dart
- name: Build site
run: dart run bin/main.dart
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Archive production artifacts
uses: actions/upload-artifact@v4
with:
name: build
path: build
deploy-production:
needs: build
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
concurrency:
group: "deploy-production"
cancel-in-progress: false
steps:
- uses: actions/checkout@v4
- name: Download a single artifact
uses: actions/download-artifact@v4
with:
name: build
path: build
- name: Install Firebase Tools
run: npm install -g firebase-tools
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT }}"
channelId: live
deploy-preview:
needs: build
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
permissions:
pull-requests: write
checks: write
concurrency:
group: "pr-${{ github.event.pull_request.number }}"
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
- name: Download a single artifact
uses: actions/download-artifact@v4
with:
name: build
path: build
- name: Install Firebase Tools
run: npm install -g firebase-tools
- uses: FirebaseExtended/action-hosting-deploy@v0
with:
repoToken: "${{ secrets.GITHUB_TOKEN }}"
firebaseServiceAccount: "${{ secrets.FIREBASE_SERVICE_ACCOUNT }}"
expires: 30d