Skip to content

Commit 9f3d0cc

Browse files
authored
[no ci] Infra Update v7: !update-configs Comment Command (#11)
* [no ci] infra: Update to v7 * [no ci] Fix ci-command.yml, add stub auto-configs-pr.json
1 parent bd9aa91 commit 9f3d0cc

4 files changed

Lines changed: 64 additions & 21 deletions

File tree

.github/workflows/cd.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
jobs:
1111
cd:
1212
name: CD
13-
uses: access-nri/build-cd/.github/workflows/cd.yml@v6
13+
uses: access-nri/build-cd/.github/workflows/cd.yml@v7
1414
with:
1515
model: ${{ vars.NAME }}
1616
spack-manifest-schema-version: 1-0-7

.github/workflows/ci-command.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Command
2+
on:
3+
issue_comment:
4+
types:
5+
- created
6+
- edited
7+
jobs:
8+
redeploy:
9+
name: Redeploy
10+
if: startsWith(github.event.comment.body, '!redeploy') && github.event.issue.pull_request
11+
uses: access-nri/build-cd/.github/workflows/ci.yml@v7
12+
with:
13+
model: ${{ vars.NAME }}
14+
pr: ${{ github.event.issue.number }}
15+
spack-manifest-schema-version: 1-0-7
16+
config-versions-schema-version: 3-0-0
17+
config-packages-schema-version: 1-0-0
18+
permissions:
19+
pull-requests: write
20+
contents: write
21+
statuses: write
22+
secrets: inherit
23+
bump:
24+
name: Bump
25+
if: startsWith(github.event.comment.body, '!bump') && github.event.issue.pull_request
26+
uses: access-nri/build-cd/.github/workflows/ci-comment.yml@v7
27+
with:
28+
model: ${{ vars.NAME }}
29+
permissions:
30+
pull-requests: write
31+
contents: write
32+
secrets: inherit
33+
configs:
34+
name: Configs
35+
if: startsWith(github.event.comment.body, '!update-configs') && github.event.issue.pull_request
36+
uses: access-nri/build-cd/.github/workflows/ci-command-configs.yml@v7
37+
with:
38+
model: ${{ vars.NAME }}
39+
auto-configs-pr-schema-version: 1-0-0
40+
permissions:
41+
pull-requests: write
42+
secrets:
43+
configs-repo-token: ${{ secrets.CONFIGS_REPO_TOKEN }}
44+
commit-gpg-private-key: ${{ secrets.GH_ACTIONS_BOT_GPG_PRIVATE_KEY }}
45+
commit-gpg-passphrase: ${{ secrets.GH_ACTIONS_BOT_GPG_PASSPHRASE }}

.github/workflows/ci.yml

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,16 @@ on:
1616
paths:
1717
- config/**
1818
- spack.yaml
19-
issue_comment:
20-
types:
21-
- created
22-
- edited
2319
jobs:
2420
pr-ci:
2521
name: CI
2622
if: >-
27-
(github.event_name == 'pull_request' && github.event.action != 'closed') || (github.event_name == 'issue_comment' && startsWith(github.event.comment.body, '!redeploy'))
28-
uses: access-nri/build-cd/.github/workflows/ci.yml@v6
23+
github.event.action != 'closed'
24+
uses: access-nri/build-cd/.github/workflows/ci.yml@v7
2925
with:
3026
model: ${{ vars.NAME }}
3127
# root-sbd: if different from vars.NAME
32-
pr: ${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.event.issue.number }}
28+
pr: ${{ github.event.pull_request.number }}
3329
spack-manifest-schema-version: 1-0-7
3430
config-versions-schema-version: 3-0-0
3531
config-packages-schema-version: 1-0-0
@@ -38,21 +34,10 @@ jobs:
3834
contents: write
3935
statuses: write
4036
secrets: inherit
41-
pr-comment:
42-
name: Comment
43-
if: github.event_name == 'issue_comment'
44-
uses: access-nri/build-cd/.github/workflows/ci-comment.yml@v6
45-
with:
46-
model: ${{ vars.NAME }}
47-
# root-sbd: if different from vars.NAME
48-
permissions:
49-
pull-requests: write
50-
contents: write
51-
secrets: inherit
5237
pr-closed:
5338
name: Closed
54-
if: github.event_name == 'pull_request' && github.event.action == 'closed'
55-
uses: access-nri/build-cd/.github/workflows/ci-closed.yml@v6
39+
if: github.event.action == 'closed'
40+
uses: access-nri/build-cd/.github/workflows/ci-closed.yml@v7
5641
with:
5742
root-sbd: ${{ vars.NAME }}
5843
secrets: inherit

config/auto-configs-pr.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/ACCESS-NRI/schema/main/au.org.access-nri/model/deployment/config/auto-configs-pr/1-0-0.json",
3+
"profiles": {
4+
5+
"default": {
6+
"configs_repo": "ACCESS-NRI/YOUR_CONFIG_REPO_HERE",
7+
"configs": {
8+
9+
}
10+
}
11+
12+
}
13+
}

0 commit comments

Comments
 (0)