Skip to content

Commit

Permalink
update github action for docker
Browse files Browse the repository at this point in the history
  • Loading branch information
nishkohli96 committed Jul 7, 2024
1 parent 5a6e7ab commit fec30f3
Showing 1 changed file with 43 additions and 31 deletions.
74 changes: 43 additions & 31 deletions .github/workflows/docker-img.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,53 @@
# name: ci
name: ci

# on:
# push:
# branches:
# - 'main'
on:
push:
branches:
- 'lib-upgrade-07-2024'

# jobs:
# docker:
# runs-on: ubuntu-latest
# steps:
# - name: Check out code
# uses: actions/checkout@v2
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2

# - name: Set up QEMU
# uses: docker/setup-qemu-action@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v2

# - name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

# - name: Get current date
# id: date
# run: echo "::set-output name=date::$(date +'%Y_%m_%d_%H_%m')"
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y_%m_%d_%H_%m')"

# - name: Build Server Image
# run: docker build -f ./apps/fastify-server/Dockerfile -t ${{secrets.DOCKER_HUB_USERNAME}}/rnm-server:${{ steps.date.outputs.date }} .
- name: Build express-server Image
run: docker build -f ./apps/express-server/Dockerfile -t ${{secrets.DOCKER_HUB_USERNAME}}/express-server:${{ steps.date.outputs.date }} .

# - name: Build react-client Image
# run: docker build -f ./apps/react-client/Dockerfile -t ${{ secrets.DOCKER_HUB_USERNAME }}/rnm-react-client:${{ steps.date.outputs.date }} .
- name: Build nestjs-server Image
run: docker build -f ./apps/nestjs-server/Dockerfile -t ${{secrets.DOCKER_HUB_USERNAME}}/nestjs-server:${{ steps.date.outputs.date }} .

# - name: Login to DockerHub
# uses: docker/login-action@v2
# with:
# username: ${{ secrets.DOCKER_HUB_USERNAME }}
# password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Build next-client Image
run: docker build -f ./apps/next-client/Dockerfile -t ${{ secrets.DOCKER_HUB_USERNAME }}/next-client:${{ steps.date.outputs.date }} .

# - name: Push Backend Image to Docker Hub
# run: docker push ${{ secrets.DOCKER_HUB_USERNAME }}/rnm-server:${{ steps.date.outputs.date }}
- name: Build react-client Image
run: docker build -f ./apps/react-client/Dockerfile -t ${{ secrets.DOCKER_HUB_USERNAME }}/react-client:${{ steps.date.outputs.date }} .

# - name: Push react-client Image to Docker Hub
# run: docker push ${{ secrets.DOCKER_HUB_USERNAME }}/rnm-react-client:${{ steps.date.outputs.date }}
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}

- name: Push express-server Image to Docker Hub
run: docker push ${{ secrets.DOCKER_HUB_USERNAME }}/express-server:${{ steps.date.outputs.date }}

- name: Push nestjs-server Image to Docker Hub
run: docker push ${{ secrets.DOCKER_HUB_USERNAME }}/nestjs-server:${{ steps.date.outputs.date }}

- name: Push next-client Image to Docker Hub
run: docker push ${{ secrets.DOCKER_HUB_USERNAME }}/next-client:${{ steps.date.outputs.date }}

- name: Push react-client Image to Docker Hub
run: docker push ${{ secrets.DOCKER_HUB_USERNAME }}/react-client:${{ steps.date.outputs.date }}

0 comments on commit fec30f3

Please sign in to comment.