feat(ci): aggiungi varianti -github dei reusable e fix audit Python
- crea gemelli X-github.yml per ogni reusable con action da github.com (fallback mirror gitea.com) - python-dependency-check/outdated: audit in venv isolata (fix falsi positivi da runner ML) - python-dependency-check/outdated: deduplica issue (commento invece di nuova issue) - examples: aggiungi ci-github.yml e release-github.yml in tutte le cartelle Fixes #3 @3h
This commit is contained in:
@@ -0,0 +1,99 @@
|
||||
name: Docker Release
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
node-version:
|
||||
type: string
|
||||
default: '24.16.0'
|
||||
npm-version:
|
||||
type: string
|
||||
default: ''
|
||||
runner:
|
||||
type: string
|
||||
default: 'catthehacker-latest'
|
||||
|
||||
jobs:
|
||||
docker-release:
|
||||
runs-on: ${{ inputs.runner }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: https://github.com/actions/checkout@v6
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: https://github.com/actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ inputs.node-version || '24.16.0' }}
|
||||
|
||||
- name: Upgrade npm
|
||||
if: inputs.npm-version != ''
|
||||
run: npm install -g npm@${{ inputs.npm-version }}
|
||||
|
||||
- name: Cache npm
|
||||
uses: https://github.com/actions/cache@v4
|
||||
with:
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
|
||||
- name: Configure npm private registry
|
||||
run: |
|
||||
echo "@pzeta:registry=https://gitea.pzetatouch.it/api/packages/pzeta_touch/npm/" >> ~/.npmrc
|
||||
echo "//gitea.pzetatouch.it/api/packages/pzeta_touch/npm/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Type check
|
||||
run: npm run typecheck
|
||||
|
||||
- name: Lint
|
||||
run: npm run lint:check
|
||||
|
||||
- name: Format check
|
||||
run: npm run format:check
|
||||
|
||||
- name: Build
|
||||
run: npm run build
|
||||
|
||||
- name: Test
|
||||
run: npm run test
|
||||
|
||||
- name: Login to container registry
|
||||
uses: https://github.com/docker/login-action@v4
|
||||
with:
|
||||
registry: gitea.pzetatouch.it
|
||||
username: ${{ secrets.G_USER }}
|
||||
password: ${{ secrets.NPM_TOKEN }}
|
||||
|
||||
- name: Determine image tags
|
||||
id: tags
|
||||
run: |
|
||||
RAW_NAME=$(jq -r '.name' package.json)
|
||||
APP_NAME=$(echo "$RAW_NAME" | sed 's|^@[^/]*/||')
|
||||
VERSION=$(jq -r '.version' package.json)
|
||||
REGISTRY="gitea.pzetatouch.it/pzeta_touch"
|
||||
echo "version_tag=${REGISTRY}/${APP_NAME}:${VERSION}" >> $GITHUB_OUTPUT
|
||||
echo "latest_tag=${REGISTRY}/${APP_NAME}:latest" >> $GITHUB_OUTPUT
|
||||
echo "version=${VERSION}" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: https://github.com/docker/build-push-action@v6
|
||||
with:
|
||||
push: true
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
tags: |
|
||||
${{ steps.tags.outputs.version_tag }}
|
||||
${{ steps.tags.outputs.latest_tag }}
|
||||
labels: |
|
||||
org.opencontainers.image.source=${{ gitea.server_url }}/${{ gitea.repository }}
|
||||
org.opencontainers.image.revision=${{ gitea.sha }}
|
||||
org.opencontainers.image.version=${{ steps.tags.outputs.version }}
|
||||
build-args: |
|
||||
NODE_VERSION=${{ vars.NODE_DOCKER_VERSION || '24.16.0-alpine3.22' }}
|
||||
NGINX_VERSION=${{ vars.NGINX_DOCKER_VERSION || '1.30.2-alpine3.23' }}
|
||||
NPM_VERSION=${{ vars.NPM_VERSION || '11.16.0' }}
|
||||
secrets: |
|
||||
npm_token=${{ secrets.NPM_TOKEN }}
|
||||
Reference in New Issue
Block a user