Skip to content

Commit

Permalink
Add github action to trigger a new docker image (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
jagudelo-gap authored and mrhammadasif committed Nov 9, 2024
1 parent 3c95c89 commit fc9108f
Showing 1 changed file with 37 additions and 35 deletions.
72 changes: 37 additions & 35 deletions .github/workflows/on-pullrequest-docker-b.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ name: On Pull Request Team B - Dockerfile

on:
push:
branches:
- AC-22
- AC-50
- AC-51
- AC-52
- AC-53
- AC-58
branches:
- AC-22
- AC-50
- AC-51
- AC-52
- AC-53
- AC-58
# pull_request:
# branches:
# - main
Expand All @@ -39,7 +39,9 @@ jobs:
fail-fast: false
matrix:
dockerfile:
[{ name: "development", path: "docker/Dockerfile", type: "local" }]
[
{ name: "development", path: "docker/Dockerfile", type: "local" },
]
steps:
- name: Checkout code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand Down Expand Up @@ -78,33 +80,33 @@ jobs:
sarif_file: sarif-${{ matrix.dockerfile.name }}.output.json

docker-publish:
name: Publish to Docker Hub
permissions:
actions: read
contents: write
runs-on: ubuntu-latest
needs:
- docker-analysis
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
name: Publish to Docker Hub
permissions:
actions: read
contents: write
runs-on: ubuntu-latest
needs:
- docker-analysis
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0

- name: Log in to Docker Hub
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
username: ${{ env.DOCKER_USERNAME }}
password: ${{ env.DOCKER_HUB_TOKEN }}
- name: Log in to Docker Hub
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
username: ${{ env.DOCKER_USERNAME }}
password: ${{ env.DOCKER_HUB_TOKEN }}

- name: Build and push admin console image
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
with:
context: "{{defaultContext}}:/"
file: docker/Dockerfile
tags: ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
push: true
- name: Build and push admin console image
uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
with:
context: "{{defaultContext}}:/"
file: docker/Dockerfile
tags: ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
push: true

- name: Extract metadata (tags, labels) for admin console image
id: metaadminconsole
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
with:
images: ${{ env.IMAGE_NAME }}
- name: Extract metadata (tags, labels) for admin console image
id: metaadminconsole
uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
with:
images: ${{ env.IMAGE_NAME }}

0 comments on commit fc9108f

Please sign in to comment.