Skip to content

Commit

Permalink
chore: Update Dockerfile and compose.yaml for containerization
Browse files Browse the repository at this point in the history
  • Loading branch information
Pradumnasaraf committed Jul 24, 2024
1 parent a069976 commit fd3a42c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 21 deletions.
18 changes: 8 additions & 10 deletions .github/workflows/publish-dockerhub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,26 @@ on:
workflow_dispatch:
release:
types: [published]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4


- name: get-npm-version
id: package-version
uses: martinbeentjes/[email protected]

- name: DockerHub Login
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}

- name: Read YAML file for version
uses: pietrobolcato/[email protected]
id: read_yaml
with:
config: ${{ github.workspace }}/version.yaml

- name: Build the Docker image
run: docker build . --file Dockerfile --tag ${{ secrets.DOCKERHUB_USERNAME }}/devops:${{ steps.read_yaml.outputs['version'] }}
run: docker build . --file Dockerfile --tag ${{ secrets.DOCKERHUB_USERNAME }}/devops:${{ steps.package-version.outputs.current-version}}

- name: Docker Push
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/devops:${{ steps.read_yaml.outputs['version'] }}
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/devops:${{ steps.package-version.outputs.current-version}}
18 changes: 7 additions & 11 deletions .github/workflows/publish-ghcr.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish Package - GHCR
name: Publish Image - GHCR

on:
release:
Expand All @@ -19,6 +19,10 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: get-npm-version
id: package-version
uses: martinbeentjes/[email protected]

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
Expand All @@ -32,18 +36,10 @@ jobs:
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Read YAML file for version
uses: pietrobolcato/[email protected]
id: read_yaml
with:
config: ${{ github.workspace }}/version.yaml

- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: |
ghcr.io/pradumnasaraf/devops:latest
ghcr.io/pradumnasaraf/devops:${{ steps.read_yaml.outputs['version'] }}
labels: ${{ steps.meta.outputs.labels }}
tags: ghcr.io/pradumnasaraf/devops:${{ steps.package-version.outputs.current-version}}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit fd3a42c

Please sign in to comment.