name: Docker # This workflow uses actions that are not certified by GitHub. # They are provided by a third-party and are governed by # separate terms of service, privacy policy, and support # documentation. on: workflow_dispatch: push: branches: ["main"] # Publish semver tags as releases. tags: ["v*"] env: REGISTRY: ghcr.io/asosnovsky jobs: build: strategy: matrix: project: ["nextcloud"] runs-on: ubuntu-latest permissions: contents: read packages: write id-token: write steps: - name: Checkout repository uses: actions/checkout@v4 - name: Install cosign uses: sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20 # v3.5.0 with: cosign-release: "v1.13.1" - name: Setup Docker buildx uses: docker/setup-buildx-action@0d103c3126aa41d772a8362f6aa67afac040f80c - name: Log into registry ${{ env.REGISTRY }} uses: docker/login-action@5139682d94efc37792e6b54386b5b470a68a4737 with: registry: ${{ env.REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Extract Docker metadata id: meta uses: docker/metadata-action@f7b4ed12385588c3f9bc252f0a2b520d83b52d48 with: images: ${{ env.REGISTRY }}/${{ matrix.project }} - name: Build and push Docker image id: build-and-push uses: docker/build-push-action@2a53c6ccda456d31fb62eedc658aae06e238b7bd with: context: ${{ matrix.project }} 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 env: COSIGN_EXPERIMENTAL: "true" run: echo "${{ steps.meta.outputs.tags }}" | xargs -I {} cosign sign {}@${{ steps.build-and-push.outputs.digest }}