Skip to content

Commit

Permalink
Enable Dockerhub containers
Browse files Browse the repository at this point in the history
  • Loading branch information
gregdenay committed Jun 4, 2024
1 parent 274208b commit cb9cbf8
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/docker-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Docker Dev

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]


jobs:
push_dockerhub:
name: Push new Docker image to Docker Hub (latest)
runs-on: ubuntu-latest
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASS: ${{ secrets.DOCKERHUB_TOKEN }}
steps:
- name: Check out pipeline code
uses: actions/checkout@v3

- name: Build new docker image
run: docker build --no-cache . -t USER/PIPELINE:devel

- name: Push Docker image to DockerHub (latest)
run: |
echo "$DOCKERHUB_PASS" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin
docker push USER/PIPELINE:devel
32 changes: 32 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Docker Publish

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]


jobs:
push_dockerhub:
name: Push new Docker image to Docker Hub (latest)
runs-on: ubuntu-latest
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASS: ${{ secrets.DOCKERHUB_TOKEN }}
steps:
- name: Check out pipeline code
uses: actions/checkout@v3

- name: Build new docker image
run: docker build --no-cache . -t USER/PIPELINE:latest

- name: Push Docker image to DockerHub (latest)
run: |
echo "$DOCKERHUB_PASS" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin
docker push ikmUSERb/PIPELINE:latest
31 changes: 31 additions & 0 deletions .github/workflows/docker-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Docker Release

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

on:
release:
types: [published]

jobs:
push_dockerhub:
name: Push new Docker image to Docker Hub (release)
runs-on: ubuntu-latest
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASS: ${{ secrets.DOCKERHUB_TOKEN }}
steps:
- name: Check out pipeline code
uses: actions/checkout@v3

- name: Build new docker image
run: docker build --no-cache . -t USER/PIPELINE:latest

- name: Push Docker image to DockerHub (release)
run: |
echo "$DOCKERHUB_PASS" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin
docker push USER/PIPELINE:latest
docker tag USER/PIPELINE:latest USER/PIPELINE:${{ github.event.release.tag_name }}
docker push USER/PIPELINE:${{ github.event.release.tag_name }}

0 comments on commit cb9cbf8

Please sign in to comment.