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
|
name: Image Build Probe
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
|
||||||
paths:
|
|
||||||
- ".forgejo/workflows/image-build.yaml"
|
|
||||||
- "Dockerfile"
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
|
|
@ -16,24 +12,20 @@ jobs:
|
||||||
image-build:
|
image-build:
|
||||||
runs-on: container-build
|
runs-on: container-build
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Build and push image (no checkout)
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Build and push image
|
|
||||||
env:
|
env:
|
||||||
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
|
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
|
||||||
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
|
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
set -eu
|
set -eux
|
||||||
mkdir -p "${HOME}/bin"
|
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
|
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}"
|
export PATH="${HOME}/bin:${PATH}"
|
||||||
docker version
|
docker version
|
||||||
echo "${REGISTRY_TOKEN}" | docker login "${REGISTRY}" -u "${REGISTRY_USER}" --password-stdin
|
echo "${REGISTRY_TOKEN}" | docker login "${REGISTRY}" -u "${REGISTRY_USER}" --password-stdin
|
||||||
TAG="${GITHUB_SHA:-manual}"
|
echo forgejo-image-build-probe-ok > buildctx/probe.txt
|
||||||
SHORT="${TAG:0:7}"
|
printf 'FROM alpine:3.20\nCOPY probe.txt /\n' > buildctx/Dockerfile
|
||||||
IMAGE="${REGISTRY}/${IMAGE_NAME}"
|
IMAGE="${REGISTRY}/${IMAGE_NAME}"
|
||||||
docker build -t "${IMAGE}:latest" -t "${IMAGE}:${SHORT}" .
|
docker build -t "${IMAGE}:dispatch-test" buildctx
|
||||||
docker push "${IMAGE}:latest"
|
docker push "${IMAGE}:dispatch-test"
|
||||||
docker push "${IMAGE}:${SHORT}"
|
echo "pushed ${IMAGE}:dispatch-test"
|
||||||
echo "pushed ${IMAGE}:latest and ${IMAGE}:${SHORT}"
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue