Skip to content

Commit

Permalink
Merge branch 'dockerhub_action_testing'
Browse files Browse the repository at this point in the history
  • Loading branch information
joachimbbp committed Sep 18, 2024
2 parents c2e4550 + 9876be7 commit c0c5bc5
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Build
on:
push:
branches:
- 'main'
push:
branches:
- 'main'
Expand Down
46 changes: 40 additions & 6 deletions .github/workflows/build_and_push.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,47 @@
name: Build and Push
#READ THIS:
#this file is on main only to test github actions. it is a WIP

name: Build And Push
on:
workflow_dispatch:
# push:
# branches:
# - 'main'
# paths:
# - Dockerfile
workflow_dispatch

jobs:
dummy:
docker:
runs-on: ubuntu-latest
environment: docker_jbbp
steps:
- name: Echo Info
run: echo "This is an empty actions file. It was created on main to reveal Build and Push files on other branches. To test this action, please run it on whatever branch holds your draft."

- name: Verify Secrets
run: echo "Username is set to \${{ secrets.DOCKERHUB_USERNAME }}"
run: echo "Username is set to ${{ secrets.DOCKERHUB_USERNAME }}"

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Set up QEMU #might not be needed
uses: docker/setup-qemu-action@v3

- name: Check Out
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

env:
DATETIME: "$(date +'%Y%m%d%H%M%S')"
- name: Set Image Tag #TODO get rid of this echo hack, put it directly in the variable
run: echo "IMAGE_TAG=joachimbbp/openvdb:openvdb_${{ env.DATETIME }}" >> $GITHUB_ENV

- name: Build and Push to Dockerhub
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ env.IMAGE_TAG }}
29 changes: 29 additions & 0 deletions .github/workflows/build_only.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Build Only
on: workflow_dispatch
jobs:
build:
runs-on: ubuntu-latest
steps:
- run: echo "🐋 Dockerfile change detected by a ${{ github.event_name }} event!"
- run: echo "🧪 This job, running on ${{ runner.os }}, will test to see if the dockerfile can successfully build an image"
- run: echo "🌳 This is running on the ${{ github.ref }} branch of ${{ github.repository }}"

- name: Check Out
uses: actions/checkout@v4
- run: echo "🏃‍➡️ ${{ github.repository }} has been cloned to ${{ runner.name }}"

- run: echo "🏗️ Setting up Docker Buildx..."
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3

env:
DATETIME: "$(date +'%Y%m%d%H%M%S')"
- name: Set Image Tag #TODO get rid of this echo hack, put it directly in the variable
run: echo "IMAGE_TAG=openvdb${{ env.DATETIME }}" >> $GITHUB_ENV


- run: echo "🚜 Building docker image ${{ env.IMAGE_TAG }}"
- name: Build Docker Image
run: docker build -t "${{ env.IMAGE_TAG }}" .

- run: echo "🏁 all steps complete"
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,5 @@ RUN python3 -m venv .venv && \
pip install -r neurovolume_deps.txt

ENTRYPOINT [ "sleep", "infinity" ]

#Comment added to test github actions 3

0 comments on commit c0c5bc5

Please sign in to comment.