diff --git a/.github/workflows/docker-dev.yml b/.github/workflows/docker-dev.yml new file mode 100644 index 0000000..52f3fdb --- /dev/null +++ b/.github/workflows/docker-dev.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml new file mode 100644 index 0000000..562c37d --- /dev/null +++ b/.github/workflows/docker-publish.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml new file mode 100644 index 0000000..6c121c4 --- /dev/null +++ b/.github/workflows/docker-release.yml @@ -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 }} \ No newline at end of file