Use Gitea-hosted Node base image
This commit is contained in:
@@ -13,7 +13,10 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: node:20-bookworm
|
image: mahgit.ir/meghdadfadaee/daily-blackout-check-base:node-20-bookworm
|
||||||
|
credentials:
|
||||||
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||||
|
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
steps:
|
steps:
|
||||||
- name: Check out repository
|
- name: Check out repository
|
||||||
uses: https://gitea.com/actions/checkout@v4
|
uses: https://gitea.com/actions/checkout@v4
|
||||||
@@ -55,10 +58,8 @@ jobs:
|
|||||||
--username "$REGISTRY_USERNAME" \
|
--username "$REGISTRY_USERNAME" \
|
||||||
--password-stdin
|
--password-stdin
|
||||||
|
|
||||||
# The runner force-pulls this job's node:20-bookworm image before the
|
docker build \
|
||||||
# job starts. Reuse that fresh host-cached image so BuildKit does not
|
--pull \
|
||||||
# make a second anonymous Docker Hub token request.
|
|
||||||
DOCKER_BUILDKIT=0 docker build \
|
|
||||||
--label "org.opencontainers.image.revision=$revision" \
|
--label "org.opencontainers.image.revision=$revision" \
|
||||||
--label "org.opencontainers.image.source=https://mahgit.ir/MeghdadFadaee/daily-blackout-check" \
|
--label "org.opencontainers.image.source=https://mahgit.ir/MeghdadFadaee/daily-blackout-check" \
|
||||||
--tag "$candidate" \
|
--tag "$candidate" \
|
||||||
|
|||||||
17
README.md
17
README.md
@@ -73,6 +73,13 @@ It contains Node for the checkout action plus Python, Git, timezone data,
|
|||||||
application dependencies, pytest, and Ruff. Scheduled jobs therefore do not
|
application dependencies, pytest, and Ruff. Scheduled jobs therefore do not
|
||||||
install Python or download Python packages.
|
install Python or download Python packages.
|
||||||
|
|
||||||
|
The Node base image is also mirrored in Gitea, so image builds do not contact
|
||||||
|
Docker Hub:
|
||||||
|
|
||||||
|
```text
|
||||||
|
mahgit.ir/meghdadfadaee/daily-blackout-check-base:node-20-bookworm
|
||||||
|
```
|
||||||
|
|
||||||
### Registry credentials
|
### Registry credentials
|
||||||
|
|
||||||
Create a Gitea personal access token for `MeghdadFadaee` with package permission
|
Create a Gitea personal access token for `MeghdadFadaee` with package permission
|
||||||
@@ -114,7 +121,8 @@ requests.
|
|||||||
|
|
||||||
The **Build runner image** workflow:
|
The **Build runner image** workflow:
|
||||||
|
|
||||||
1. Starts in `node:20-bookworm` and installs the Docker client.
|
1. Starts in the Gitea-hosted `daily-blackout-check-base:node-20-bookworm`
|
||||||
|
image and installs the Docker client.
|
||||||
2. Builds using only `runner-image/` as context, so `.env` and outage state are
|
2. Builds using only `runner-image/` as context, so `.env` and outage state are
|
||||||
never included.
|
never included.
|
||||||
3. Runs import, pytest, and Ruff smoke checks inside the candidate image.
|
3. Runs import, pytest, and Ruff smoke checks inside the candidate image.
|
||||||
@@ -122,9 +130,10 @@ The **Build runner image** workflow:
|
|||||||
5. Updates `latest` only after the candidate passes verification.
|
5. Updates `latest` only after the candidate passes verification.
|
||||||
|
|
||||||
It runs automatically when `runner-image/**` changes on `main` and can also be
|
It runs automatically when `runner-image/**` changes on `main` and can also be
|
||||||
started manually. Image builds require Debian mirrors, Docker Hub, PyPI, Gitea,
|
started manually. Image builds require Debian mirrors, PyPI, Gitea, and access
|
||||||
and access to the Docker socket. Normal test and hourly runs only need Gitea,
|
to the Docker socket. Normal test and hourly runs only need Gitea, `gitea.com`,
|
||||||
`gitea.com`, SAAPA, and EitaaYar.
|
SAAPA, and EitaaYar. The mirrored Node image is intentionally static; refresh it
|
||||||
|
from the upstream `node:20-bookworm` image when adopting Node security updates.
|
||||||
|
|
||||||
Deployment order:
|
Deployment order:
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM node:20-bookworm
|
FROM mahgit.ir/meghdadfadaee/daily-blackout-check-base:node-20-bookworm
|
||||||
|
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
||||||
|
|||||||
Reference in New Issue
Block a user