Skip to content

Added CI infra, configs and spack.yaml #1

Added CI infra, configs and spack.yaml

Added CI infra, configs and spack.yaml #1

Workflow file for this run

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