@@ -3,140 +3,99 @@ name: "CI / Application JS Cloudflare Feature"
33on :
44 workflow_call :
55 inputs :
6- appHostname :
7- type : string
8- required : true
96 ref :
107 type : string
118 default : master
129 description : >
1310 Reference used for this repository, so we can re-use it when
1411 referencing local actions, and avoid having to checkout this
1512 repository separately.
16-
1713 secrets :
18- GH_TOKEN :
19- required : true
2014 NIXPKGS_PRIVATE_PAT :
2115 required : true
2216 DEPLOY_SECRETS :
2317 required : true
24- # CLOUDFLARE_ACCOUNT_ID:
25- # required: true
26- # CLOUDFLARE_ZONE_ID:
27- # required: true
28- # CLOUDFLARE_API_TOKEN:
29- # required: true
30- # ZETA_HOUSE_ENV:
31- # required: true
32- # ZETA_HOUSE_SUPABASE_URL:
33- # required: true
34- # ZETA_HOUSE_SUPABASE_KEY:
35- # required: true
36- # ZETA_HOUSE_SENDGRID_API_KEY:
37- # required: true
38- # ZETA_HOUSE_GOOGLE_MAPS_API_KEY:
39- # required: true
40-
41- env :
42- NIX_CONFIG : access-tokens = github.com=${{ secrets.NIXPKGS_PRIVATE_PAT }}
4318
4419jobs :
45- feature-debug :
46- name : " Feature / Debug"
20+ # Lint the code
21+ feature-lint :
22+ name : " Feature / Lint"
4723 runs-on : ubuntu-latest
24+ container :
25+ image : ghcr.io/matrixai/github-runner
26+ permissions :
27+ packages : read
28+ contents : read
4829 steps :
49- # - uses: actions/checkout@v4
50- # with:
51- # repository: MatrixAI/.github
52- # ref: ${{ inputs.ref }}
53- # path: tmp/.github
54- # - uses: ./tmp/.github/.github/actions/secrets-parse
55- # with:
56- # secrets: ${{ secrets.DEPLOY_SECRETS }}
57- - uses : MatrixAI/.github/.github/actions/secrets-parse@${{ inputs.ref }}
58- with :
59- secrets : ${{ secrets.DEPLOY_SECRETS }}
60- - name : Next Part
30+ - uses : actions/checkout@v4
31+ - name : Run linting
32+ env :
33+ NIX_CONFIG : access-tokens = github.com=${{ secrets.NIXPKGS_PRIVATE_PAT }}
6134 run : |
62- echo $SECRET1
63- echo $SECRET2
64- echo $SECRET3
65-
66- # # Lint the code
67- # feature-lint:
68- # name: "Feature / Lint"
69- # runs-on: ubuntu-latest
70- # container:
71- # image: ghcr.io/matrixai/github-runner
72- # permissions:
73- # packages: read
74- # contents: read
75- # steps:
76- # - uses: actions/checkout@v4
77- # - name: Run linting
78- # run: |
79- # nix develop .#ci --command bash -c $'
80- # npm run lint
81- # '
35+ nix develop .#ci --command bash -c $'
36+ npm run lint
37+ '
8238
83- # # Build the public
84- # feature-build:
85- # name: "Feature / Build"
86- # runs-on: ubuntu-latest
87- # container:
88- # image: ghcr.io/matrixai/github-runner
89- # permissions:
90- # packages: read
91- # contents: read
92- # actions: write
93- # steps:
94- # - uses: actions/checkout@v4
95- # with:
96- # lfs: true
97- # - name: Run build
98- # run: |
99- # nix develop .#ci --command bash -c $'
100- # npm run build --verbose
101- # '
102- # - name: Upload Build
103- # uses: actions/upload-artifact@v4
104- # with:
105- # name: public
106- # path: ./public
39+ # Build the public
40+ feature-build :
41+ name : " Feature / Build"
42+ runs-on : ubuntu-latest
43+ container :
44+ image : ghcr.io/matrixai/github-runner
45+ permissions :
46+ packages : read
47+ contents : read
48+ actions : write
49+ steps :
50+ - uses : actions/checkout@v4
51+ with :
52+ lfs : true
53+ - name : Run build
54+ env :
55+ NIX_CONFIG : access-tokens = github.com=${{ secrets.NIXPKGS_PRIVATE_PAT }}
56+ run : |
57+ nix develop .#ci --command bash -c $'
58+ npm run build --verbose
59+ '
60+ - name : Upload Build
61+ uses : actions/upload-artifact@v4
62+ with :
63+ name : public
64+ path : ./public
10765
108- # # Deploy the public
109- # feature-deployment:
110- # name: "Feature / Deployment"
111- # runs-on: ubuntu-latest
112- # needs: feature-build
113- # container:
114- # image: ghcr.io/matrixai/github-runner
115- # concurrency:
116- # group: feature-deployment
117- # cancel-in-progress: false
118- # steps:
119- # - uses: actions/checkout@v4
120- # with:
121- # lfs: true
122- # - uses: actions/download-artifact@v4
123- # with:
124- # name: public
125- # path: ./public
126- # - name: Setup Deploy Secrets
127- # run: |
128- # echo "${{ inputs.DEPLOY_SECRETS }}" | jq -r 'to_entries | .[] | "\(.key)=\(.value)"' >> $GITHUB_ENV
129- # - name: Run deployment
130- # env:
131- # name: "feature/${{ github.ref_name }}"
132- # url: "https://${{ github.ref_name }}.dev.${{ inputs.appHostname }}"
133- # run: |
134- # echo 'Perform service deployment for feature'
135- # echo "$SECRET1"
136- # echo "$SECRET2"
137- # echo "$SECRET3"
138- # nix develop .#ci --command bash -c $'
139- # npm run deploy -- \
140- # --feature "$GITHUB_REF_NAME" \
141- # --env "$GITHUB_REF_NAME"
142- # '
66+ # Deploy the public
67+ feature-deployment :
68+ name : " Feature / Deployment"
69+ runs-on : ubuntu-latest
70+ needs : feature-build
71+ container :
72+ image : ghcr.io/matrixai/github-runner
73+ concurrency :
74+ group : feature-deployment
75+ cancel-in-progress : false
76+ steps :
77+ - uses : actions/checkout@v4
78+ with :
79+ repository : MatrixAI/.github
80+ ref : ${{ inputs.ref }}
81+ path : tmp/.github
82+ - uses : ./tmp/.github/.github/actions/secrets-parse
83+ with :
84+ secrets : ${{ secrets.DEPLOY_SECRETS }}
85+ - uses : actions/checkout@v4
86+ with :
87+ lfs : true
88+ - uses : actions/download-artifact@v4
89+ with :
90+ name : public
91+ path : ./public
92+ - name : Run deployment
93+ env :
94+ NIX_CONFIG : access-tokens = github.com=${{ secrets.NIXPKGS_PRIVATE_PAT }}
95+ run : |
96+ echo 'Perform service deployment for feature'
97+ nix develop .#ci --command bash -c $'
98+ npm run deploy -- \
99+ --feature "$GITHUB_REF_NAME" \
100+ --env "$GITHUB_REF_NAME"
101+ '
0 commit comments