Add .gitea/workflows/*.yaml

This commit is contained in:
2025-10-18 20:32:35 -07:00
parent 17c32c00d3
commit 0ac7387f38

View File

@@ -103,19 +103,13 @@ jobs:
with: with:
name: image name: image
path: /tmp path: /tmp
# Trivy CLI install (no Docker needed)
- name: Install Trivy CLI - name: Install Trivy CLI
run: | run: |
set -euo pipefail set -euo pipefail
curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh \ curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh \
| sh -s -- -b /usr/local/bin v0.65.0 | sh -s -- -b /usr/local/bin v0.65.0
trivy --version trivy --version
- name: Scan saved image tar with Trivy
# IMPORTANT: the tar sits under /tmp/image.tar
- name: Scan saved image tar with Trivy (no daemon)
run: | run: |
ls -la /tmp || true ls -la /tmp || true
trivy image \ trivy image \
@@ -124,7 +118,6 @@ jobs:
--output /tmp/trivy-results.json \ --output /tmp/trivy-results.json \
--severity CRITICAL,HIGH \ --severity CRITICAL,HIGH \
--ignore-unfixed --ignore-unfixed
- name: Upload results - name: Upload results
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
@@ -144,11 +137,10 @@ jobs:
run: | run: |
docker load --input /tmp/image.tar docker load --input /tmp/image.tar
docker image ls -a docker image ls -a
- name: Login to DockerHub - name: Login to Gitea Docker Registry
uses: docker/login-action@v3 run: |
with: echo "${{ secrets.REGISTRY_TOKEN }}" | \
username: ${{ secrets.REGISTRY_USER }} docker login gitea.cuihang1201.synology.me -u ${{ secrets.REGISTRY_USER }} --password-stdin
password: ${{ secrets.REGISTRY_TOKEN }} - name: Push Docker image
- name: Docker push image to DockerHub
run: | run: |
docker push ${{ vars.IMAGE }}:${{ inputs.image-tag }} docker push ${{ vars.IMAGE }}:${{ inputs.image-tag }}