mirror of
https://github.com/Syping/dtranslatebot.git
synced 2026-04-01 05:20:22 +02:00
CI: add Container Image
This commit is contained in:
parent
34996ba363
commit
cf134599a7
2 changed files with 46 additions and 5 deletions
42
.github/workflows/container.yml
vendored
Normal file
42
.github/workflows/container.yml
vendored
Normal file
|
|
@ -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
|
||||||
9
.github/workflows/linux-rpm.yml
vendored
9
.github/workflows/linux-rpm.yml
vendored
|
|
@ -1,5 +1,4 @@
|
||||||
name: Linux
|
name: Linux
|
||||||
on: push
|
|
||||||
jobs:
|
jobs:
|
||||||
Release:
|
Release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
@ -14,7 +13,7 @@ jobs:
|
||||||
version: lp155
|
version: lp155
|
||||||
steps:
|
steps:
|
||||||
- name: Cloning
|
- name: Cloning
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v6
|
||||||
- name: Preparing
|
- name: Preparing
|
||||||
run: mkdir -m 777 ${{github.workspace}}/rpms
|
run: mkdir -m 777 ${{github.workspace}}/rpms
|
||||||
- name: Build RPM
|
- name: Build RPM
|
||||||
|
|
@ -36,8 +35,8 @@ jobs:
|
||||||
rpmbuild/SPECS
|
rpmbuild/SPECS
|
||||||
rpmbuild -ba rpmbuild/SPECS/dtranslatebot.spec
|
rpmbuild -ba rpmbuild/SPECS/dtranslatebot.spec
|
||||||
- name: Upload
|
- name: Upload
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v7
|
||||||
with:
|
with:
|
||||||
name: ${{matrix.name}}
|
name: ${{matrix.name}}
|
||||||
path: |
|
path: ${{github.workspace}}/rpms/x86_64/*.rpm
|
||||||
${{github.workspace}}/rpms/x86_64/*.rpm
|
on: push
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue