45 lines
1.3 KiB
YAML
45 lines
1.3 KiB
YAML
name: Build and push Docker images
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- master
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- service: claude
|
|
context: ./claude
|
|
- service: proxy
|
|
context: ./proxy
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Log in to ${{ vars.REGISTRY_URL }}
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ vars.REGISTRY_URL }}
|
|
username: ${{ vars.REGISTRY_USER }}
|
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
|
|
|
- name: Build and push ${{ matrix.service }}
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: ${{ matrix.context }}
|
|
push: true
|
|
tags: |
|
|
${{ vars.REGISTRY_URL }}/${{ vars.REGISTRY_USER }}/${{ matrix.service }}:latest
|
|
${{ vars.REGISTRY_URL }}/${{ vars.REGISTRY_USER }}/${{ matrix.service }}:${{ github.sha }}
|
|
cache-from: type=registry,ref=${{ vars.REGISTRY_URL }}/${{ vars.REGISTRY_USER }}/${{ matrix.service }}:cache
|
|
cache-to: type=registry,ref=${{ vars.REGISTRY_URL }}/${{ vars.REGISTRY_USER }}/${{ matrix.service }}:cache,mode=max
|