Fasit Rollout #410
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: Fasit Rollout | |
on: | |
workflow_run: | |
workflows: [ | |
"Helm Chart", | |
"Container Image" | |
] | |
branches: [ main ] | |
types: | |
- completed | |
env: | |
ARTIFACT_REGISTRY: europe-north1-docker.pkg.dev | |
ARTIFACT_REPO: nais-io/nais/feature | |
jobs: | |
meta: | |
name: Metadata | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.version.outputs.version }} | |
name: ${{ steps.name.outputs.name }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- id: version | |
run: echo "version=$(date +'%Y%m%d')-$(git rev-parse --short HEAD)" >> ${GITHUB_OUTPUT} | |
- id: name | |
run: echo "name=${{ github.event.repository.name }}" >> ${GITHUB_OUTPUT} | |
wait: | |
name: Wait for workflows | |
runs-on: ubuntu-latest | |
needs: meta | |
steps: | |
- uses: ahmadnassri/action-workflow-run-wait@2aa3d9e1a12ecaaa9908e368eaf2123bb084323e | |
rollout-crds: | |
name: Rollout CRDs to Fasit | |
runs-on: fasit-deploy | |
permissions: | |
id-token: write | |
needs: [meta, wait] | |
steps: | |
- name: Deploy CRDs | |
uses: nais/fasit-deploy@v2 | |
with: | |
chart: oci://${{ env.ARTIFACT_REGISTRY }}/${{ env.ARTIFACT_REPO }}/${{ needs.meta.outputs.name }}-crds | |
version: ${{ needs.meta.outputs.version }} | |
rollout-controller: | |
name: Rollout Controller to Fasit | |
runs-on: fasit-deploy | |
permissions: | |
id-token: write | |
needs: [meta, rollout-crds] | |
steps: | |
- name: Deploy Operator | |
uses: nais/fasit-deploy@v2 | |
with: | |
chart: oci://${{ env.ARTIFACT_REGISTRY }}/${{ env.ARTIFACT_REPO }}/${{ needs.meta.outputs.name }} | |
version: ${{ needs.meta.outputs.version }} | |
git-tag: | |
runs-on: ubuntu-latest | |
needs: [meta, rollout-controller] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: git tag and push | |
run: | | |
git tag ${{ needs.meta.outputs.version }} | |
git push origin ${{ needs.meta.outputs.version }} |