Debug image-build without checkout
This commit is contained in:
parent
b25a6f042f
commit
2ec3466ab3
1 changed files with 8 additions and 16 deletions
|
|
@ -1,10 +1,6 @@
|
|||
name: Image Build Probe
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- ".forgejo/workflows/image-build.yaml"
|
||||
- "Dockerfile"
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
|
|
@ -16,24 +12,20 @@ jobs:
|
|||
image-build:
|
||||
runs-on: container-build
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Build and push image
|
||||
- name: Build and push image (no checkout)
|
||||
env:
|
||||
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
|
||||
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
|
||||
run: |
|
||||
set -eu
|
||||
mkdir -p "${HOME}/bin"
|
||||
set -eux
|
||||
mkdir -p "${HOME}/bin" buildctx
|
||||
wget -qO- https://download.docker.com/linux/static/stable/x86_64/docker-27.3.1.tgz | tar xz --strip-components=1 -C "${HOME}/bin" docker/docker
|
||||
export PATH="${HOME}/bin:${PATH}"
|
||||
docker version
|
||||
echo "${REGISTRY_TOKEN}" | docker login "${REGISTRY}" -u "${REGISTRY_USER}" --password-stdin
|
||||
TAG="${GITHUB_SHA:-manual}"
|
||||
SHORT="${TAG:0:7}"
|
||||
echo forgejo-image-build-probe-ok > buildctx/probe.txt
|
||||
printf 'FROM alpine:3.20\nCOPY probe.txt /\n' > buildctx/Dockerfile
|
||||
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}"
|
||||
docker build -t "${IMAGE}:dispatch-test" buildctx
|
||||
docker push "${IMAGE}:dispatch-test"
|
||||
echo "pushed ${IMAGE}:dispatch-test"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue