env vars db #2
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 Build And Push | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build backend Docker image | |
working-directory: ./backend | |
env: | |
DATABASE_URL: ${{ secrets.DATABASE_URL }} | |
GOOGLE_CLIENT_ID: ${{ secrets.GOOGLE_CLIENT_ID }} | |
GOOGLE_CLIENT_SECRET: ${{ secrets.GOOGLE_CLIENT_SECRET }} | |
BASE_URL: ${{ secrets.BASE_URL }} | |
CLIENT_URL: ${{ secrets.CLIENT_URL }} | |
run: docker build --build-arg DATABASE_URL=$DATABASE_URL --build-arg GOOGLE_CLIENT_ID=$GOOGLE_CLIENT_ID --build-arg GOOGLE_CLIENT_SECRET=$GOOGLE_CLIENT_SECRET --build-arg BASE_URL=$BASE_URL --build-arg CLIENT_URL=$CLIENT_URL . --file Dockerfile --tag maneeshwije/markdown-edit-backend | |
- uses: actions/checkout@v3 | |
- name: Build frontend Docker image | |
working-directory: ./frontend | |
env: | |
VITE_SERVER_URL: ${{ secrets.VITE_SERVER_URL }} | |
run: docker build --build-arg VITE_SERVER_URL=$VITE_SERVER_URL . --file Dockerfile --tag maneeshwije/markdown-edit-frontend | |
- name: Log in to DockerHub | |
run: echo "${{ secrets.DOCKERHUB_PASSWORD }}" | docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin | |
- name: Push Docker images to DockerHub | |
run: docker push maneeshwije/markdown-edit-backend && docker push maneeshwije/markdown-edit-frontend |