51 lines
No EOL
1.3 KiB
YAML
51 lines
No EOL
1.3 KiB
YAML
name: Build and Push Docker Image
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- develop
|
|
pull_request:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Create BuildKit config with custom hosts
|
|
run: |
|
|
mkdir -p ~/.docker
|
|
cat > ~/.docker/buildkitd.toml <<EOF
|
|
[registry."git.avatic.de"]
|
|
http = false
|
|
|
|
[worker.oci]
|
|
max-parallelism = 4
|
|
EOF
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
with:
|
|
driver-opts: network=host
|
|
buildkitd-flags: --allow-insecure-entitlement network.host
|
|
config: ~/.docker/buildkitd.toml
|
|
|
|
- name: Login to Gitea Container Registry
|
|
run: |
|
|
echo "${{ secrets.REGISTRY_TOKEN }}" | docker login git.avatic.de -u "${{ gitea.actor }}" --password-stdin
|
|
|
|
- name: Build and push
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: .
|
|
push: true
|
|
network: host
|
|
allow: network.host
|
|
tags: |
|
|
git.avatic.de/${{ gitea.repository_owner }}/lcc:${{ gitea.sha }}
|
|
git.avatic.de/${{ gitea.repository_owner }}/lcc:latest |