fix: modernize docker publishing

This commit is contained in:
2026-04-29 09:14:10 +00:00
parent 578e804306
commit 8a26f1cbba
7 changed files with 301 additions and 157 deletions
+12 -48
View File
@@ -1,4 +1,4 @@
name: Docker (tags)
name: Docker (non-tag pushes)
on:
push:
@@ -7,43 +7,11 @@ on:
env:
IMAGE: code.foss.global/host.today/ht-docker-node:szci
SZCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@/${{gitea.repository}}.git
SZCI_TOKEN_NPM: ${{secrets.SZCI_TOKEN_NPM}}
SZCI_TOKEN_NPM2: ${{secrets.SZCI_TOKEN_NPM2}}
SZCI_GIT_GITHUBTOKEN: ${{secrets.SZCI_GIT_GITHUBTOKEN}}
SZCI_LOGIN_DOCKER_GITEA: ${{ github.server_url }}|${{ gitea.repository_owner }}|${{ secrets.GITEA_TOKEN }}
SZCI_LOGIN_DOCKER_DOCKERREGISTRY: ${{ secrets.SZCI_LOGIN_DOCKER_DOCKERREGISTRY }}
NPMCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@gitea.lossless.digital/${{gitea.repository}}.git
NPMCI_LOGIN_DOCKER_DOCKERREGISTRY: ${{ secrets.NPMCI_LOGIN_DOCKER_DOCKERREGISTRY }}
jobs:
security:
runs-on: ubuntu-latest
container:
image: ${{ env.IMAGE }}
continue-on-error: true
steps:
- uses: actions/checkout@v3
- name: Install pnpm and szci
run: |
pnpm install -g pnpm
pnpm install -g @ship.zone/szci
szci npm prepare
- name: Audit production dependencies
run: |
npm config set registry https://registry.npmjs.org
pnpm audit --audit-level=high --prod
continue-on-error: true
- name: Audit development dependencies
run: |
npm config set registry https://registry.npmjs.org
pnpm audit --audit-level=high --dev
continue-on-error: true
test:
needs: security
runs-on: ubuntu-latest
container:
image: ${{ env.IMAGE }}
@@ -54,18 +22,14 @@ jobs:
- name: Prepare
run: |
pnpm install -g pnpm
pnpm install -g @ship.zone/szci
szci npm prepare
pnpm install -g @git.zone/tsdocker@latest
pnpm install
- name: Test stable
run: |
szci node install stable
szci npm install
szci npm test
- name: Test
run: pnpm test
- name: Test build
run: |
szci npm prepare
szci node install stable
szci npm install
npm run build
- name: Build image
run: tsdocker build
- name: Test image
run: tsdocker test
+19 -70
View File
@@ -7,74 +7,14 @@ on:
env:
IMAGE: code.foss.global/host.today/ht-docker-node:szci
SZCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@/${{gitea.repository}}.git
SZCI_TOKEN_NPM: ${{secrets.SZCI_TOKEN_NPM}}
SZCI_TOKEN_NPM2: ${{secrets.SZCI_TOKEN_NPM2}}
SZCI_GIT_GITHUBTOKEN: ${{secrets.SZCI_GIT_GITHUBTOKEN}}
SZCI_LOGIN_DOCKER_GITEA: ${{ github.server_url }}|${{ gitea.repository_owner }}|${{ secrets.GITEA_TOKEN }}
SZCI_LOGIN_DOCKER_DOCKERREGISTRY: ${{ secrets.SZCI_LOGIN_DOCKER_DOCKERREGISTRY }}
NPMCI_COMPUTED_REPOURL: https://${{gitea.repository_owner}}:${{secrets.GITEA_TOKEN}}@gitea.lossless.digital/${{gitea.repository}}.git
NPMCI_LOGIN_DOCKER_DOCKERREGISTRY: ${{ secrets.NPMCI_LOGIN_DOCKER_DOCKERREGISTRY }}
jobs:
security:
runs-on: ubuntu-latest
container:
image: ${{ env.IMAGE }}
continue-on-error: true
steps:
- uses: actions/checkout@v3
- name: Prepare
run: |
pnpm install -g pnpm
pnpm install -g @ship.zone/szci
szci npm prepare
- name: Audit production dependencies
run: |
npm config set registry https://registry.npmjs.org
pnpm audit --audit-level=high --prod
continue-on-error: true
- name: Audit development dependencies
run: |
npm config set registry https://registry.npmjs.org
pnpm audit --audit-level=high --dev
continue-on-error: true
test:
needs: security
runs-on: ubuntu-latest
container:
image: ${{ env.IMAGE }}
steps:
- uses: actions/checkout@v3
- name: Prepare
run: |
pnpm install -g pnpm
pnpm install -g @ship.zone/szci
szci npm prepare
- name: Test stable
run: |
szci node install stable
szci npm install
szci npm test
- name: Test build
run: |
szci node install stable
szci npm install
npm run build
release:
needs: test
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
container:
image: code.foss.global/host.today/ht-docker-node:dbase
image: code.foss.global/host.today/ht-docker-dbase:szci
steps:
- uses: actions/checkout@v3
@@ -82,11 +22,20 @@ jobs:
- name: Prepare
run: |
pnpm install -g pnpm
pnpm install -g @ship.zone/szci
pnpm install -g @git.zone/tsdocker@latest
pnpm install
- name: Release
run: |
szci docker login
szci docker build
szci docker test
szci docker push
- name: Login to registries
run: tsdocker login
- name: List images
run: tsdocker list
- name: Build images
run: tsdocker build
- name: Test images
run: tsdocker test
- name: Push to code.foss.global
run: tsdocker push code.foss.global