Add image-build workflow for T04 CI proof
This commit is contained in:
parent
0ecb2f7b5f
commit
7ce1d4c965
1 changed files with 37 additions and 0 deletions
37
.forgejo/workflows/image-build.yaml
Normal file
37
.forgejo/workflows/image-build.yaml
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
name: Image Build Probe
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
paths:
|
||||||
|
- ".forgejo/workflows/image-build.yaml"
|
||||||
|
- "Dockerfile"
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
env:
|
||||||
|
REGISTRY: forgejo.coulomb.social
|
||||||
|
IMAGE_NAME: coulomb/forgejo-actions-probe
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
image-build:
|
||||||
|
runs-on: container-build
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Login to Forgejo registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ${{ env.REGISTRY }}
|
||||||
|
username: ${{ secrets.REGISTRY_USER }}
|
||||||
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
run: |
|
||||||
|
set -eu
|
||||||
|
TAG="${GITHUB_SHA:-manual}"
|
||||||
|
SHORT="${TAG:0:7}"
|
||||||
|
IMAGE="${REGISTRY}/${IMAGE_NAME}"
|
||||||
|
docker build -t "${IMAGE}:latest" -t "${IMAGE}:${SHORT}" .
|
||||||
|
docker push "${IMAGE}:latest"
|
||||||
|
docker push "${IMAGE}:${SHORT}"
|
||||||
|
echo "pushed ${IMAGE}:latest and ${IMAGE}:${SHORT}"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue