Skip to content

docs(paste-server-rs): add README.md and production.compose.yml #19

docs(paste-server-rs): add README.md and production.compose.yml

docs(paste-server-rs): add README.md and production.compose.yml #19

name: paste-server-rs
on:
push:
branches:
- master
paths:
- '.github/workflows/paste-server-rs.yml'
- 'paste-server-rs/**'
pull_request:
branches:
- master
paths:
- '.github/workflows/paste-server-rs.yml'
- 'paste-server-rs/**'
workflow_dispatch:
env:
REGISTRY: ghcr.io
IMAGE_NAME: aosc-dev/paste-server-rs
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable
- name: Cache cargo dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/
~/.cargo/git/
paste-server-rs/target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Check formatting
run: cd paste-server-rs && cargo fmt -- --check
- name: Lint
run: cd paste-server-rs && cargo clippy -- -D warnings
- name: Build
run: cd paste-server-rs && cargo build --verbose --release
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: paste-server-rs
path: paste-server-rs/target/release/paste-server-rs
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
id: push
uses: docker/build-push-action@v6
with:
context: "{{defaultContext}}:paste-server-rs"
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v3
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true