Share user data to navbars #73
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 Images CI/CD | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
env: | |
REGISTRY: ghcr.io | |
API_IMAGE_TAG: ghcr.io/ahkim3/pantryprofiler-api:latest | |
UI_IMAGE_TAG: ghcr.io/ahkim3/pantryprofiler-ui:latest | |
jobs: | |
build-and-push-images: | |
environment: BUILD_ENV_DB_CONFIG | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Log in to the Container registry | |
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and push the Docker image for the API | |
run: | | |
docker build -t ${{ env.API_IMAGE_TAG }} \ | |
--build-arg DB_SERVER_ARG=${{ secrets.DB_SERVER }} \ | |
--build-arg DB_NAME_ARG=${{ secrets.DB_NAME }} \ | |
--build-arg DB_USER_ARG=${{ secrets.DB_USER }} \ | |
--build-arg DB_PASSWORD_ARG=${{ secrets.DB_PASSWORD }} \ | |
./backend | |
docker push ${{ env.API_IMAGE_TAG }} | |
env: | |
API_IMAGE_TAG: ${{ env.API_IMAGE_TAG }} | |
- name: Build and push the Docker image for the UI | |
run: | | |
docker build -t ${{ env.UI_IMAGE_TAG }} ./frontend | |
docker push ${{ env.UI_IMAGE_TAG }} | |
env: | |
API_IMAGE_TAG: ${{ env.UI_IMAGE_TAG }} |