[revise]: revise dockerfile #49
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: Build and Push Docker Image | |
on: | |
push: | |
branches: | |
- develop | |
env: | |
REGISTRY: ghcr.io | |
jobs: | |
build-and-push-image: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
apps: | |
- apps | |
context: | |
- pwrcode-frontend | |
- pwrcode-backend | |
steps: | |
- name: checkout repository | |
uses: actions/checkout@v4 | |
- name: Login in to Container registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.IMHOHEONG_GITHUB_ACCESS_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 | |
with: | |
images: ${{ env.REGISTRY }}/IMHOJEONG/${{ matrix.context }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
no-cache: true | |
context: ./${{ matrix.apps }}/${{ matrix.context }} | |
push: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
platforms: linux/amd64, linux/arm64, linux/arm64/v8 | |
build-args: | | |
"DATABASE_HOST=${{ secrets.DATABASE_HOST }}" | |
"DATABASE_USER=${{ secrets.DATABASE_USER }}" | |
"DATABASE_PASS=${{ secrets.DATABASE_PASS }}" | |
"MEILISEARCH_HOST=${{ secrets.MEILISEARCH_HOST }}" |