Skip to content

Commit

Permalink
add self hosted example and update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
NicholasCote authored Aug 5, 2024
1 parent 0e3d587 commit c31b4df
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/self-hosted-example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# 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 main branch
on:
push:
paths:
- August-08-2024/**
branches:
- main

# 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 self-hosted runner 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 container image
- 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
# Use podman to build the image and tag it with the current date
- name: Build and push image
run: podman build -t docker.io/ncging/workshop-webapp:${{ steps.date.outputs.date }} .
# Login to Harbor with a robot account for the ncote project in Harbor
- name: Login to Docker Hub
run: podman login docker.io -u ${{ secrets.DOCKERHUB_USERNAME }} -p ${{ secrets.DOCKERHUB_TOKEN }}
# Push the image to Harbor
- name: Push image to Harbor
run: podman push docker.io/ncging/workshop-webapp:${{ steps.date.outputs.date }}
27 changes: 27 additions & 0 deletions August-08-2024/walkthrough.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,15 @@
"```"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"```note\n",
"Remember to update the tag so that it uses your Docker Hub repository name.\n",
"```"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -283,6 +292,15 @@
"```"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"```note\n",
"Remember to update the tag so that it uses your Docker Hub repository name.\n",
"```"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -402,6 +420,15 @@
"```"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"```note\n",
"Remember to update the tag so that it uses your Docker Hub repository name.\n",
"```"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down

0 comments on commit c31b4df

Please sign in to comment.