Skip to content

Commit

Permalink
docker ci-cd updates
Browse files Browse the repository at this point in the history
  • Loading branch information
smalho01 committed Oct 5, 2023
1 parent 1adb8bf commit 33ce0f2
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 8 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/docker-cd-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Docker Development Image CD

on:
push:
branches: [ dev ]
workflow_dispatch:

jobs:
docker-cd:
runs-on: ubuntu-latest
steps:

- name: Checkout Repository
uses: actions/checkout@v3
with:
submodules: true

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Docker meta data
id: docker-meta-data
uses: docker/metadata-action@v4
with:
images: codexrems/request-generator
flavor: latest=false

- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Build and push Server Docker image
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: codexrems/request-generator:experimental
labels: ${{ steps.docker-meta-data.outputs.labels }}
25 changes: 20 additions & 5 deletions .github/workflows/docker-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,40 @@ name: Docker Image CD

on:
push:
branches: [ master ]
branches: [ main ]
workflow_dispatch:

jobs:
docker-cd:
runs-on: ubuntu-latest
steps:

- name: Checkout Repository
uses: actions/checkout@v2

uses: actions/checkout@v3
with:
submodules: true

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Docker meta data
id: docker-meta-data
uses: docker/metadata-action@v4
with:
images: codexrems/request-generator
flavor: latest=false

- name: Log in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Build and push Server Docker image
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: codexrems/crd-request-generator:REMSvCurrent
tags: codexrems/request-generator:latest
labels: ${{ steps.docker-meta-data.outputs.labels }}
8 changes: 5 additions & 3 deletions .github/workflows/docker-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Docker Image CI

on:
pull_request:
branches: [ master ]
branches: [ main, dev ]
workflow_dispatch:


Expand All @@ -12,7 +12,9 @@ jobs:
steps:

- name: Checkout Repository
uses: actions/checkout@v2

uses: actions/checkout@v3
with:
submodules: true

- name: Test Server Docker image Builds
run: docker build .
41 changes: 41 additions & 0 deletions .github/workflows/docker-tag-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Docker Tagged Image CD
on:
workflow_dispatch:
push:
tags:
- '*'

jobs:
docker:
runs-on: ubuntu-latest
steps:

- name: Checkout Repository
uses: actions/checkout@v3
with:
submodules: true

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Docker meta data
id: docker-meta-data
uses: docker/metadata-action@v4
with:
images: codexrems/request-generator
flavor: latest=false

- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.docker-meta-data.outputs.tags }}
labels: ${{ steps.docker-meta-data.outputs.labels }}

0 comments on commit 33ce0f2

Please sign in to comment.