-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (45 loc) · 1.43 KB
/
ci-closed.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
name: PR Closed Cleanup
run-name: ${{ inputs.model }} PR Closed Cleanup
# Remove prereleases that were part of a closed PR, so we save space
# on our deployment targets. If needed, one can still get the
# spack.yaml as part of the closed PR and revive it themselves.
# NOTE: the caller requires the following permissions:
# secrets:inherit
on:
workflow_call:
inputs:
model:
type: string
required: true
description: The model that is being tested and deployed
# Callers usually have the trigger:
# pull_request:
# types:
# - closed
# branches:
# - main
# - backport/*.*
# paths:
# - config/**
# - spack.yaml
jobs:
setup:
name: Setup
runs-on: ubuntu-latest
outputs:
version-pattern: ${{ steps.version.outputs.pattern }}
steps:
- name: Version Pattern
id: version
# For example, `access-om3-pr12-*`
run: |
repo_name_sanitized=$(echo ${{ github.event.repository.name }} | tr [:upper:] [:lower:] | tr '.' 'p' )
echo "pattern=${repo_name_sanitized}-pr${{ github.event.pull_request.number }}-*" >> $GITHUB_OUTPUT
undeploy-prereleases:
name: Undeploy Prereleases Matching ${{ needs.setup.outputs.version-pattern }}
needs:
- setup
uses: access-nri/build-cd/.github/workflows/undeploy-1-setup.yml@main
with:
version-pattern: ${{ needs.setup.outputs.version-pattern }}
secrets: inherit