Update runner-diagram.drawio #69
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
# This workflow builds container images and pushes them to the NSF NCAR Harbor Container Repository | |
# Set the workflow name | |
name: GitHub Runner Build, Push, & Update | |
# Define the trigger that starts the action | |
# For this workflow the trigger is on a push that changes anything in the configs/jupyter/base-notebook/ path | |
on: | |
- push | |
# Define the actions that are going to take place as part of this workflow | |
jobs: | |
# Name the job(s) | |
build-push-gh-runner-cicd: | |
# Define where the job should run in this case it will be run on the latest ubuntu image | |
runs-on: self-hosted | |
# Set the steps to take in order | |
steps: | |
# Step 1 is to checkout the github repo used to build the Dockerfile | |
- name: Check out the repo | |
uses: actions/checkout@v4 | |
# Get the date to apply to image tag | |
- name: Get current date | |
id: date | |
run: echo "date=$(date +'%Y-%m-%d.%H.%M')" >> $GITHUB_OUTPUT | |
- name: Build and push image | |
run: podman build -t hub.k8s.ucar.edu/ncote/github-runner:${{ steps.date.outputs.date }} . | |
- name: Login to Harbor | |
run: podman login hub.k8s.ucar.edu -u robot-ncote+ncote -p ${{ secrets.HARBOR_ROBOT_PW }} | |
- name: Push image to Harbor | |
run: podman push hub.k8s.ucar.edu/ncote/github-runner:${{ steps.date.outputs.date }} | |
- name: Update Helm values.yaml | |
run: | | |
sed -i '12d' gh-runner-helm/values.yaml | |
echo " image: hub.k8s.ucar.edu/ncote/github-runner:${{ steps.date.outputs.date }}" >> gh-runner-helm/values.yaml | |
- name: Update Helm Chart.yaml | |
run: | | |
sed -i '24d' gh-runner-helm/Chart.yaml | |
echo "appVersion: '${{ steps.date.outputs.date }}'" >> gh-runner-helm/Chart.yaml | |
- name: Commit changes to main branch | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "$GITHUB_ACTOR" | |
git commit -a -m "Update Helm chart via GH Actions" | |
git push |