Update docker_pipe.yml #24
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: CI/CD Pipeline | |
on: | |
push: | |
branches: | |
- docker_config | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
# Set up Docker Buildx | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
# Log in to DockerHub (or another container registry) | |
- name: Log in to DockerHub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Get Date | |
id: date | |
run: echo "DATE=$(date +'%Y%m%d')" >> $GITHUB_ENV | |
# Build and push the frontend image | |
- name: Build and Push Frontend Image | |
uses: docker/build-push-action@v4 | |
with: | |
push: true | |
context: ./Frontend/ | |
file: ./Frontend/Dockerfile | |
platforms: linux/amd64 | |
tags: | | |
hartypotter/frontend:latest | |
hartypotter/frontend:${{ env.DATE }} | |
# Build and push the backend image | |
- name: Build and Push Backend Image | |
uses: docker/build-push-action@v4 | |
with: | |
push: true | |
context: ./Backend/ | |
file: ./Backend/Dockerfile | |
platforms: linux/amd64 | |
tags: | | |
hartypotter/backend:latest | |
hartypotter/backend:${{ env.DATE }} | |
secrets: | | |
"DATABASE_URL=${{ secrets.DATABASE_URL }}" |