ci(docker): add github action to build docker images automatically

This commit is contained in:
Amruth Pillai 2022-03-07 14:02:40 +01:00
parent 938e2e8e25
commit 1a0ab6fb22
No known key found for this signature in database
GPG Key ID: E3C57DF9B80855AD
1 changed files with 35 additions and 0 deletions

35
.github/workflows/docker-build-push.yml vendored Normal file
View File

@ -0,0 +1,35 @@
name: Build and Push to Docker Hub
on:
push:
branches: v3
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout the repository
uses: actions/checkout@v3.0.0
- name: Login to Docker Hub
uses: docker/login-action@v1.14.1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and Push Server Docker Image
uses: docker/build-push-action@v2.9.0
with:
context: .
push: true
file: {{context}}/server/Dockerfile
tags: amruthpillai/reactive-resume:server-latest
- name: Build and Push Client Docker Image
uses: docker/build-push-action@v2.9.0
with:
context: .
push: true
file: {{context}}/client/Dockerfile
tags: amruthpillai/reactive-resume:client-latest