Merge pull request #289 from codersforcauses/increment-amount #121
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Docker Image CI | |
on: | |
push: | |
branches: ["main"] | |
workflow_dispatch: | |
jobs: | |
backend: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Get the date | |
id: date | |
run: echo "::set-output name=date::$(date +'%Y%m%d%H%M%S')" | |
# Login | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ vars.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
# Server Docker image | |
- name: Build and push the server Docker image | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: ./docker/server/Dockerfile | |
push: true | |
tags: ${{ vars.DOCKERHUB_USERNAME}}/csf-prod-server:${{ steps.date.outputs.date }}, ${{ vars.DOCKERHUB_USERNAME }}/csf-prod-server:latest | |
frontend: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Get the date | |
id: date | |
run: echo "::set-output name=date::$(date +'%Y%m%d%H%M%S')" | |
# Login | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ vars.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
# Client Docker image | |
- name: Build and push the client Docker image | |
uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: ./docker/client/Dockerfile | |
push: true | |
tags: ${{ vars.DOCKERHUB_USERNAME}}/csf-prod-client:${{ steps.date.outputs.date }}, ${{ vars.DOCKERHUB_USERNAME }}/csf-prod-client:latest |