Fix image-build: single-step docker install+push
This commit is contained in:
parent
cc12a1270f
commit
b25a6f042f
1 changed files with 7 additions and 12 deletions
|
|
@ -19,22 +19,17 @@ jobs:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install docker CLI (static binary)
|
- name: Build and push image
|
||||||
|
env:
|
||||||
|
REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
|
||||||
|
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
run: |
|
run: |
|
||||||
set -eu
|
set -eu
|
||||||
mkdir -p "${HOME}/bin"
|
mkdir -p "${HOME}/bin"
|
||||||
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
|
||||||
echo "${HOME}/bin" >> "${GITHUB_PATH}"
|
export PATH="${HOME}/bin:${PATH}"
|
||||||
"${HOME}/bin/docker" version
|
docker version
|
||||||
|
echo "${REGISTRY_TOKEN}" | docker login "${REGISTRY}" -u "${REGISTRY_USER}" --password-stdin
|
||||||
- name: Login to Forgejo registry
|
|
||||||
run: |
|
|
||||||
set -eu
|
|
||||||
echo "${{ secrets.REGISTRY_TOKEN }}" | docker login "${REGISTRY}" -u "${{ secrets.REGISTRY_USER }}" --password-stdin
|
|
||||||
|
|
||||||
- name: Build and push
|
|
||||||
run: |
|
|
||||||
set -eu
|
|
||||||
TAG="${GITHUB_SHA:-manual}"
|
TAG="${GITHUB_SHA:-manual}"
|
||||||
SHORT="${TAG:0:7}"
|
SHORT="${TAG:0:7}"
|
||||||
IMAGE="${REGISTRY}/${IMAGE_NAME}"
|
IMAGE="${REGISTRY}/${IMAGE_NAME}"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue