-
Notifications
You must be signed in to change notification settings - Fork 32
39 lines (37 loc) · 1.51 KB
/
test.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# This workflow builds docker images and pushes them to a Docker Hub Repository
# This workflow is specific to the podman-notebook directory and image
# Set the workflow name
name: JHub Podman Build Test
# Define the trigger that starts the action
# For this workflow the trigger is on a push that changes anything in the images/podman-notebook/ path
on:
push:
paths:
- podman-notebook/**
# Define the actions that are going to take place as part of this workflow
jobs:
build-image:
# Use the latest ubuntu image to run the jobs
runs-on: nbviz-runner-set
steps:
# Step 1 is to checkout the github repo used to build the Dockerfile
- name: Check out the repo
uses: actions/checkout@v4
# Step 2 is to login to docker hub so the image can be pushed
# Get the date and send to GITHUB_OUTPUT to apply as image tag
- name: Get current date
id: date
run: echo "date=$(date +'%Y-%m-%d.%H')" >> $GITHUB_OUTPUT
# Build and push the docker image
- name: Build Docker image
uses: docker/build-push-action@v4
with:
# Provide the current directory as build context
context: .
# Specify where the Dockerfile is located in relation to the repo base path
file: Containerfile
# Enable the push to docker hub
push: false
# Provide the tags to apply to the image, this example uses the latest image tag
tags: |
ncote/nbviz2cntnr:${{ steps.date.outputs.date }}