From 008f379cb09ddfca30ced7860b176aae477819e8 Mon Sep 17 00:00:00 2001 From: sthope Date: Tue, 18 Mar 2025 19:52:14 +0100 Subject: [PATCH] first commit --- .gitea/workflows/build.yml | 50 +++++--------------------------------- 1 file changed, 6 insertions(+), 44 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 8efa314..d70b1fc 100755 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -10,8 +10,8 @@ on: branches: [ "main" ] env: - # Use docker.io for Docker Hub if empty - REGISTRY: ghcr.io + # Use docker.io or ghcr.io + REGISTRY: docker.io IMAGE_NAME: ${{ github.repository }} IMAGE: "sthopeless/gitea-actions-repos-compare" @@ -29,53 +29,15 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 - - name: Install cosign - if: github.event_name != 'pull_request' - uses: sigstore/cosign-installer@v3.8.1 - with: - cosign-release: 'v2.2.4' - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Log into registry ${{ env.REGISTRY }} - if: github.event_name != 'pull_request' uses: docker/login-action@v3 with: registry: ${{ env.REGISTRY }} username: ${{ secrets.GH_USER }} password: ${{ secrets.GH_TOKEN }} - - name: Extract Docker metadata - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE }} - tags: | - type=raw,value=latest,enable={{is_default_branch}} - labels: | - org.opencontainers.image.source=${{ github.repository }} - org.opencontainers.image.revision=${{ github.sha }} - org.opencontainers.image.created=${{ steps.meta.outputs.created }} - org.opencontainers.image.authors=${{ steps.meta.outputs.authors }} - org.opencontainers.image.title=${{ github.repository }} - org.opencontainers.image.description=${{ github.repository }} - org.opencontainers.image.url=${{ github.event.repository.html_url }} + - name: Build Docker image + id: build + run: | + echo "${{ env.REGISTRY }} - ${{ env.IMAGE_NAME }} - ${{ env.IMAGE }}" - - name: Build and push Docker image - id: build-and-push - uses: docker/build-push-action@v5 - with: - context: . - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - cache-from: type=gha - cache-to: type=gha,mode=max - - - name: Sign the published Docker image - if: ${{ github.event_name != 'pull_request' }} - env: - TAGS: ${{ steps.meta.outputs.tags }} - DIGEST: ${{ steps.build-and-push.outputs.digest }} - run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST} \ No newline at end of file