Skip to content

Commit 60811d4

Browse files
committed
Added README.md changes and more debug output
1 parent 22c0daa commit 60811d4

File tree

2 files changed

+44
-34
lines changed

2 files changed

+44
-34
lines changed

.github/workflows/undeploy-2-start.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
if: always()
4747
run: |
4848
if [[ "${{ steps.undeploy.outcome }}" == "success" ]]; then
49-
echo "::notice::Deployment ${{ inputs.env-name }} was successfully removed from ${{ inputs.deployment-environment }}"
49+
echo "::notice::Deployment ${{ inputs.env-name }} was successfully removed from ${{ inputs.deployment-environment }}, found at ${{ vars.SPACK_LOCATION }}"
5050
else
51-
echo "::error::Deployment ${{ inputs.env-name }} couldn't be removed from ${{ inputs.deployment-environment}}. Please check manually."
51+
echo "::error::Deployment ${{ inputs.env-name }} couldn't be removed from ${{ inputs.deployment-environment}}, found at ${{ vars.SPACK_LOCATION }}. Please check manually."
5252
fi

README.md

+42-32
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,35 @@ This workflow obtains the relevant spack and GitHub Environment information, and
3333

3434
Using the GitHub Environment, it `ssh`s into the deployment environments `spack` instance, and installs the model associated with the repository that called it. It then copies back relevant metadata and creates a versioned GitHub Release in the caller repository, if it is not a `prerelease` deployment.
3535

36+
#### Usage
37+
38+
For supported `spack`-installable ACCESS-NRI models, simply call the `deploy-1-setup.yml` reusable workflow from the given repositories workflow file, as shown below. Don't forget to add required inputs!
39+
40+
```yml
41+
deploy:
42+
uses: access-nri/build-cd/.github/workflows/deploy-1-setup.yml@main
43+
with:
44+
version: 1.2.3
45+
secrets: inherit
46+
permissions:
47+
contents: write
48+
```
49+
3650
### `undeploy-*`
3751

52+
For given `spack` environments, we can also remove deployments. For example:
53+
54+
```yml
55+
remove-prereleases:
56+
uses: access-nri/build-cd/.github/workflows/undeploy-2-setup.yml@main
57+
with:
58+
version-pattern: ${{ inputs.model }}-*
59+
secrets: inherit
60+
```
61+
62+
This will remove every `spack` environment from the deployment target that matches `<model>-*`.
63+
64+
3865
#### Inputs
3966

4067
| Name | Type | Description | Required | Default | Example |
@@ -53,13 +80,27 @@ This workflow obtains the relevant spack and GitHub Environment information, and
5380

5481
Using the GitHub Environment, it `ssh`s into the deployment environments `spack` instance, and installs the model associated with the repository that called it. It then copies back relevant metadata and creates a versioned GitHub Release in the caller repository, if it is not a `prerelease` deployment.
5582

83+
#### Usage
84+
85+
For given `spack` environments, we can also remove deployments. For example:
86+
87+
```yml
88+
remove-prereleases:
89+
uses: access-nri/build-cd/.github/workflows/undeploy-2-setup.yml@main
90+
with:
91+
version-pattern: ${{ inputs.model }}-pre*
92+
secrets: inherit
93+
```
94+
95+
This will remove every `spack` environment from the deployment target that matches `<model>-pre*`.
96+
5697
### `validate-json.yml`
5798

5899
This workflow is used to validate the `config` folders `*.json` files based on their associated `*.schema.json`. This is used for PR checks on the `build-cd` repo itself.
59100

60101
### `create-deployment-spack.yml`
61102

62-
This workflow is used to create a version of `spack` on `Gadi`.
103+
This workflow_dispatch-triggered workflow is used to create a version of `spack` on `Gadi`.
63104

64105
#### Inputs
65106

@@ -69,34 +110,3 @@ This workflow is used to create a version of `spack` on `Gadi`.
69110
| `spack-packages-version` | string | A version of ACCESS-NRI/spack-packages to be bundled with the install of `spack` | true | `main` | `2023.11.12` |
70111
| `spack-config-version` | string | A version of ACCESS-NRI/spack-config to be bundled with the install of `spack` | true | `main` | `2024.01.01` |
71112
| `deployment-location` | true | A path in the deployment environment where Spack should be created. For example, if it is `opt/spack`, spack will be installed under `opt/spack/<spack-version>/` | true | N/A | `/opt/spack` |
72-
73-
## Usage
74-
75-
### Deployment
76-
77-
For supported `spack`-installable ACCESS-NRI models, simply call the `deploy-1-setup.yml` reusable workflow from the given repositories workflow file, as shown below. Don't forget to add required inputs!
78-
79-
```yml
80-
deploy:
81-
uses: access-nri/build-cd/.github/workflows/deploy-1-setup.yml@main
82-
with:
83-
type: release
84-
version: 1.2.3
85-
secrets: inherit
86-
permissions:
87-
contents: write
88-
```
89-
90-
### Removing Deployment
91-
92-
For given `spack` environments, we can also remove deployments. For example:
93-
94-
```yml
95-
remove-prereleases:
96-
uses: access-nri/build-cd/.github/workflows/undeploy-2-setup.yml@main
97-
with:
98-
version-pattern: ${{ inputs.model }}-pre*
99-
secrets: inherit
100-
```
101-
102-
This will remove every `spack` environment from the deployment target that matches `<model>-pre*`.

0 commit comments

Comments
 (0)