Add .gitea/workflows/*.yaml

This commit is contained in:
2025-10-18 20:57:21 -07:00
parent 0ac7387f38
commit c4bd57ba93

View File

@@ -58,22 +58,20 @@ jobs:
steps: steps:
- name: Checkout source code - name: Checkout source code
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@v3
- name: Build and export - name: Build and export
uses: docker/build-push-action@v5 # Build Docker image via Dockerfile uses: docker/build-push-action@v5 # Build Docker image via Dockerfile
with: with:
context: backend # Directory of Dockerfile context: backend # Directory of Dockerfile
tags: ${{ inputs.image-name }}:${{ inputs.image-tag }} tags: ${{ inputs.image-name }}:${{ inputs.image-tag }}
outputs: type=docker,dest=/tmp/image.tar outputs: type=docker,dest=/tmp/image.tar
- name: Upload artifact - name: Upload artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: image name: image
path: /tmp/image.tar path: /tmp/image.tar
retention-days: 2
integration-tests: integration-tests:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
@@ -123,6 +121,7 @@ jobs:
with: with:
name: trivy-results name: trivy-results
path: /tmp/trivy-results.json path: /tmp/trivy-results.json
retention-days: 2
publish-image: publish-image:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
@@ -143,4 +142,5 @@ jobs:
docker login gitea.cuihang1201.synology.me -u ${{ secrets.REGISTRY_USER }} --password-stdin docker login gitea.cuihang1201.synology.me -u ${{ secrets.REGISTRY_USER }} --password-stdin
- name: Push Docker image - name: Push Docker image
run: | run: |
docker push ${{ vars.IMAGE }}:${{ inputs.image-tag }} docker push ${{ inputs.image-name }}:${{ inputs.image-tag }}
docker rmi ${{ inputs.image-name }}:${{ inputs.image-tag }}