CD bash vars now doesn't use '-' #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CD | |
on: | |
push: | |
branches: | |
- main | |
- backport/*.* | |
paths: | |
- config/** | |
- spack.yaml | |
jobs: | |
generate-tag: | |
name: Generate Tag Name | |
# Get the tag name from the `spack.yaml` that was merged into main, which | |
# is of the form `access-om2@git.<version>`. | |
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 access-om2 spec in the `spack.yaml`. | |
# The `cut` command splits the `access-om2@git.<version>` field into just `<version>`, | |
# which will be the new tag. | |
run: | | |
access_om2_package=$(yq e '.spack.specs[0]' spack.yaml) | |
echo "name=${access_om2_package/*@git./}" >> $GITHUB_OUTPUT | |
undeploy-prereleases: | |
name: Undeploy Prereleases | |
needs: | |
- generate-tag | |
runs-on: ubuntu-latest | |
steps: | |
- run: echo "Pretending to undeploy prereleases with pattern ${{ needs.generate-tag.outputs.name}}-*" | |
# uses: access-nri/build-cd/.github/workflows/undeploy-1-setup.yml@main | |
# with: | |
# version-pattern: ${{ needs.generate-tag.outputs.name }}-* | |
# secrets: inherit | |
push-tag: | |
name: Tag Deployment | |
needs: | |
- generate-tag | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Push Tag | |
# NOTE: Regarding the config user.name/user.email, see https://github.com/actions/checkout/pull/1184 | |
run: | | |
git config user.name github-actions[bot] | |
git config user.email 41898282+github-actions[bot]@users.noreply.github.com | |
git tag ${{ needs.generate-tag.outputs.name }} --force | |
git push --tags --force | |
deploy-release: | |
name: Deploy Release | |
needs: | |
- generate-tag | |
- push-tag | |
runs-on: ubuntu-latest | |
steps: | |
- run: echo "Pretending to deploy to release with ref ${{ github.ref_name }} and version ${{ needs.generate-tag.outputs.name }}" | |
# uses: access-nri/build-cd/.github/workflows/deploy-1-setup.yml@main | |
# with: | |
# ref: ${{ github.ref_name }} | |
# version: ${{ needs.generate-tag.outputs.name }} | |
# secrets: inherit | |
# permissions: | |
# contents: write |