ci: add Forgejo action to build and push Docker images to registry
This commit is contained in:
parent
659fb3f339
commit
1dbbbc840d
1 changed files with 45 additions and 0 deletions
45
.forgejo/workflows/docker-build.yml
Normal file
45
.forgejo/workflows/docker-build.yml
Normal file
|
|
@ -0,0 +1,45 @@
|
||||||
|
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
|
||||||
Loading…
Add table
Add a link
Reference in a new issue