-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (44 loc) · 1.32 KB
/
cd.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: CD
on:
push:
branches:
- main
- backport/*.*
paths:
- config/**
- spack.yaml
env:
SPACK_YAML_MODEL_YQ: .spack.specs[0]
jobs:
push-tag:
name: Tag Deployment
runs-on: ubuntu-latest
permissions:
contents: write
outputs:
name: ${{ steps.tag.outputs.name }}
steps:
- uses: actions/checkout@v4
- name: Generate Tag
id: tag
# Get the tag name from the `spack.yaml` that was merged into main, which
# is of the form `access-om3@git.<version>`.
run: echo "name=$(yq '${{ env.SPACK_YAML_MODEL_YQ }} | split("@git.") | .[1]' spack.yaml)" >> $GITHUB_OUTPUT
- name: Push Tag
# NOTE: Regarding the config user.name/user.email, see https://github.com/actions/checkout/pull/1184
run: |
git config user.name ${{ vars.GH_ACTIONS_BOT_GIT_USER_NAME }}
git config user.email ${{ vars.GH_ACTIONS_BOT_GIT_USER_EMAIL }}
git tag ${{ steps.tag.outputs.name }} --force
git push --tags --force
deploy-release:
name: Deploy Release
needs:
- push-tag
uses: access-nri/build-cd/.github/workflows/deploy-1-setup.yml@main
with:
ref: ${{ github.ref_name }}
version: ${{ needs.push-tag.outputs.name }}
secrets: inherit
permissions:
contents: write