41 lines
1 KiB
YAML
41 lines
1 KiB
YAML
|
|
name: Docker Build & Push
|
||
|
|
|
||
|
|
on:
|
||
|
|
push:
|
||
|
|
branches: [main]
|
||
|
|
pull_request:
|
||
|
|
branches: [main]
|
||
|
|
workflow_dispatch:
|
||
|
|
|
||
|
|
jobs:
|
||
|
|
build:
|
||
|
|
runs-on: docker
|
||
|
|
steps:
|
||
|
|
- name: Checkout code
|
||
|
|
uses: actions/checkout@v4
|
||
|
|
|
||
|
|
- name: Set up Docker Buildx
|
||
|
|
uses: docker/setup-buildx-action@v3
|
||
|
|
|
||
|
|
- name: Login to Forgejo Container Registry
|
||
|
|
if: github.ref == 'refs/heads/main'
|
||
|
|
uses: docker/login-action@v3
|
||
|
|
with:
|
||
|
|
registry: 192.168.178.6:8083
|
||
|
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
||
|
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
||
|
|
|
||
|
|
- name: Build only (pull request)
|
||
|
|
if: github.event_name == 'pull_request'
|
||
|
|
run: |
|
||
|
|
docker buildx build \
|
||
|
|
--platform linux/amd64 .
|
||
|
|
|
||
|
|
- name: Build and push (main)
|
||
|
|
if: github.ref == 'refs/heads/main'
|
||
|
|
run: |
|
||
|
|
docker buildx build --push \
|
||
|
|
--tag 192.168.178.6:8083/cschulz/rd13_media_wiki:latest \
|
||
|
|
--platform linux/amd64 \
|
||
|
|
--output type=registry,registry.insecure=true .
|