Automatic deploy server #5
Workflow file for this run
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: Automatic build and push images to Docker | |
on: workflow_dispatch | |
jobs: | |
docker: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: true | |
matrix: | |
include: | |
- dockerfile: ./server-web/Dockerfile | |
image: thaidmfinnick/fmecg-node-app | |
context: server-web | |
- dockerfile: ./frontend_web/Dockerfile | |
image: thaidmfinnick/fmecg-react-app | |
context: frontend_web | |
- dockerfile: ./frontend_web/bin/Dockerfile | |
image: thaidmfinnick/fmecg-bin-login | |
context: frontend_web/bin | |
- dockerfile: ./proxy/Dockerfile | |
image: thaidmfinnick/fmecg-proxy | |
context: proxy | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ matrix.image }} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v5 | |
with: | |
context: ${{ matrix.context }} | |
file: ${{ matrix.dockerfile }} | |
push: true | |
tags: latest | |
labels: ${{ steps.meta.outputs.labels }} |