diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 905e8d4..15bf4b4 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,5 +1,8 @@ name: Build on: + push: + branches: + - 'main' push: branches: - 'main' diff --git a/.github/workflows/build_and_push.yaml b/.github/workflows/build_and_push.yaml index 19895de..deca59b 100644 --- a/.github/workflows/build_and_push.yaml +++ b/.github/workflows/build_and_push.yaml @@ -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 }} \ No newline at end of file diff --git a/.github/workflows/build_only.yaml b/.github/workflows/build_only.yaml new file mode 100644 index 0000000..0612b9f --- /dev/null +++ b/.github/workflows/build_only.yaml @@ -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" \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 7a95dee..9c9913a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 \ No newline at end of file