Files
alert-message-center/.github/workflows/ci.yml
2026-01-12 15:08:31 +08:00

50 lines
1.2 KiB
YAML

name: Build and Push Docker Images
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Server image
uses: docker/build-push-action@v5
with:
context: .
file: apps/server/Dockerfile
push: true
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-server:latest
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-server:${{ github.sha }}
- name: Build and push Web image
uses: docker/build-push-action@v5
with:
context: .
file: apps/web/Dockerfile
push: true
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-web:latest
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-web:${{ github.sha }}