-
Notifications
You must be signed in to change notification settings - Fork 0
77 lines (71 loc) · 2.17 KB
/
publish.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
on:
push:
branches: [main, dynamic-matrix]
jobs:
prepare:
name: Prepare Matrix Output
runs-on: ubuntu-latest
outputs:
matrix: ${{steps.matrix.outputs.matrix}}
steps:
- name: Checkout
uses: actions/checkout@v3
# - name: Setting SITES
# run: echo "SITES=$(jq -c . < sites.json)" >> $GITHUB_ENV
# doesn't work with "act"
- name: Packages Changed
id: changes
with:
list-files: shell
filters: |
deps:
- 'package.json'
sites:
- 'sites/**'
packages:
- 'packages/**'
uses: dorny/paths-filter@v3
- name: Inspect Packages Changed
run: |
echo "Outputs: ${{ steps.changes.outputs }}"
echo "Changes: ${{ steps.changes.outputs.changes }}"
echo "Packages Changed: ${{ steps.changes.outputs.packages_files }}"
# - name: Build Dynamic Matrix
# id: matrix
# run: node scripts/build_sites.mjs
# 1. get the packages changed
# 2. If the core package was changed, deploy all sites
# 3. If only a certain site OR sites was changed, only deploy those sites.
# 4. Build the matrix JSON structure as seen below dynamically based on the above conditions
# publish:
# needs: prepare
# name: Publish to Cloudflare Pages
# runs-on: ubuntu-latest
# strategy:
# matrix: ${{ fromJson(needs.prepare.outputs.matrix) }}
#
# permissions:
# contents: read
# deployments: write
#
# steps:
# - name: Debug
# run: |
# echo "Package: ${{ matrix.project }}"
# echo "Project: ${{ matrix.package }}"
# - name: Checkout
# uses: actions/checkout@v3
#
# - name: Install Dependencies
# run: npm ci --omit=dev
#
# - name: Build
# run: npm run build -w ./sites/${{ matrix.package }}
#
# - name: Publish to Cloudflare Pages
# uses: cloudflare/pages-action@v1
# with:
# apiToken: ${{ secrets.DEPLOY_TOKEN }}
# accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
# projectName: ${{ matrix.project }}
# directory: ./sites/${{ matrix.package }}/dist