Add docker-build.yml: build + push :latest to registry.alwisp.com on the host runner
Build and Push Docker Image / build (push) Successful in 40s
Build and Push Docker Image / build (push) Successful in 40s
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
name: Build and Push Docker Image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
# Runs on the forgerunner host: bundled Docker CLI + mounted /var/run/docker.sock.
|
||||
runs-on: host
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Log in to Gitea Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: registry.alwisp.com
|
||||
username: ${{ secrets.REGISTRY_USER }}
|
||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||
|
||||
- name: Build and Push
|
||||
run: |
|
||||
# gitea.repository is already "owner/repo" (e.g. jason/breedr).
|
||||
IMAGE="registry.alwisp.com/${{ gitea.repository }}"
|
||||
docker build -t "${IMAGE}:latest" .
|
||||
docker push "${IMAGE}:latest"
|
||||
Reference in New Issue
Block a user