From cf134599a72e74dc736688514170480842a14100 Mon Sep 17 00:00:00 2001 From: Syping Date: Sat, 21 Mar 2026 20:06:18 +0100 Subject: [PATCH] CI: add Container Image --- .github/workflows/container.yml | 42 +++++++++++++++++++++++++++++++++ .github/workflows/linux-rpm.yml | 9 ++++--- 2 files changed, 46 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/container.yml diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml new file mode 100644 index 0000000..64cd59b --- /dev/null +++ b/.github/workflows/container.yml @@ -0,0 +1,42 @@ +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} +name: Container +jobs: + Release: + runs-on: ubuntu-latest + steps: + - name: Cloning + uses: actions/checkout@v6 + - name: Login to GitHub Container Registry + uses: docker/login-action@v4 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Extract metadata for Container + id: meta + uses: docker/metadata-action@v6 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + - name: Build and push Container + id: push + uses: docker/build-push-action@v7 + with: + context: . + file: Containerfile + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + - name: Generate Artifact Attestation + uses: actions/attest@v4 + with: + subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}} + subject-digest: ${{ steps.push.outputs.digest }} + push-to-registry: true +on: push +permissions: + attestations: write + contents: read + id-token: write + packages: write diff --git a/.github/workflows/linux-rpm.yml b/.github/workflows/linux-rpm.yml index e710a11..c78d408 100644 --- a/.github/workflows/linux-rpm.yml +++ b/.github/workflows/linux-rpm.yml @@ -1,5 +1,4 @@ name: Linux -on: push jobs: Release: runs-on: ubuntu-latest @@ -14,7 +13,7 @@ jobs: version: lp155 steps: - name: Cloning - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Preparing run: mkdir -m 777 ${{github.workspace}}/rpms - name: Build RPM @@ -36,8 +35,8 @@ jobs: rpmbuild/SPECS rpmbuild -ba rpmbuild/SPECS/dtranslatebot.spec - name: Upload - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: ${{matrix.name}} - path: | - ${{github.workspace}}/rpms/x86_64/*.rpm + path: ${{github.workspace}}/rpms/x86_64/*.rpm +on: push