forked from dart-lang/site-www
-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (100 loc) · 3.16 KB
/
build.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
name: build
on:
# Run on PRs and pushes to the default branch.
push:
branches:
- main
pull_request:
branches:
- main
schedule:
- cron: "0 0 * * 0"
# Declare default permissions as read only.
permissions: read-all
env:
# Keep for Dart SDK reporting
PUB_ENVIRONMENT: bot.github
# LTS
NODE_VERSION: '16'
# Tool location
BASE_DIR: ${{ github.workspace }}
TOOL_DIR: ${{ github.workspace }}/tool
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
sdk: [stable, beta, dev]
steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
with:
submodules: recursive
- uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d
with:
sdk: ${{ matrix.sdk }}
- run: dart pub get
- run: tool/test.sh
env:
DART_CHANNEL: ${{ matrix.sdk }}
deploy:
permissions:
checks: write
pull-requests: write
if: ${{ github.event_name == 'push' &&
github.ref == 'refs/heads/main' &&
github.repository == 'dart-lang/site-www' }}
needs: test
runs-on: ubuntu-latest
env:
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
FIREBASE_PROJECT: default
steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
with:
submodules: recursive
- run: make build
- run: make write-prod-robots
- uses: actions/setup-node@969bd2663942d722d85b6a8626225850c2f7be4b
with:
node-version: ${{ env.NODE_VERSION }}
- run: npm install -g [email protected]
- uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d
with:
sdk: stable
- run: tool/check-links.sh
- uses: FirebaseExtended/action-hosting-deploy@ff6e7dde58a4f7f1db590927596bf683250c6cc8
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_DART_DEV }}'
projectId: dart-dev
channelId: live
stage:
permissions:
checks: write
pull-requests: write
if: ${{ github.ref != 'refs/heads/main' }}
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
with:
submodules: recursive
- run: make build
- uses: actions/setup-node@969bd2663942d722d85b6a8626225850c2f7be4b
with:
node-version: ${{ env.NODE_VERSION }}
- run: npm install -g [email protected]
- uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d
with:
sdk: stable
- run: tool/check-links.sh
- name: Stage site on Firebase
if: ${{
github.event.pull_request.head.repo.full_name == github.repository &&
github.event.pull_request.user.login != 'dependabot[bot]' }}
uses: FirebaseExtended/action-hosting-deploy@ff6e7dde58a4f7f1db590927596bf683250c6cc8
with:
repoToken: '${{ secrets.GITHUB_TOKEN }}'
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_DART_DEV }}'
projectId: dart-dev