Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Rust build artifacts
**/*.rs.bk
*.pdb

# Docker specific
Dockerfile*
docker-compose*
.docker/

# Git and version control
.git*

# Documentation
/docs

# Project build files
Cargo.lock
**/.cargo-ok

# Test artifacts
**/*test-*
**/*Test*

# Editor configs
.editorconfig

/target
/.idea
*~
Thumbs.db
.DS*
/.vscode/*.log
.*~
4 changes: 0 additions & 4 deletions .gitea/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ on: [push, pull_request]

name: Continuous integration for Rust

env:
RUSTUP_UPDATE_ROOT: "https://mirrors.cernet.edu.cn/rustup/rustup"
RUSTUP_DIST_SERVER: "https://mirrors.cernet.edu.cn/rustup"

jobs:
check:
name: Check the code with cargo check
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/deploy_image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Create and publish a Docker image

on:
push:
branches: ["main"]

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.REPO_PASSWD }}
Comment on lines +23 to +27
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Specify Version for docker/login-action
The static analysis tool indicates that the action reference does not include a version. This may lead to unpredictable behavior. Please update the reference to include a version tag, for example:

-        uses: docker/login-action
+        uses: docker/login-action@v2
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
uses: docker/login-action
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.REPO_PASSWD }}
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.REPO_PASSWD }}
🧰 Tools
🪛 actionlint (1.7.4)

23-23: specifying action "docker/login-action" in invalid format because ref is missing. available formats are "{owner}/{repo}@{ref}" or "{owner}/{repo}/{path}@{ref}"

(action)

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
Comment on lines +29 to +32
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Update docker/metadata-action to a Newer Version
According to the static analysis hint, the runner for “docker/metadata-action@v3” is considered too old. Upgrading to a later version (e.g., v4) can improve compatibility with the latest GitHub Actions environment. Consider making the following change:

-        uses: docker/metadata-action@v3
+        uses: docker/metadata-action@v4
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
id: meta
- uses: docker/metadata-action@v3
+ uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
🧰 Tools
🪛 actionlint (1.7.4)

30-30: the runner of "docker/metadata-action@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

- name: Build and push Docker image
id: push
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: |
latest
${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Comment on lines +33 to +42
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Upgrade docker/build-push-action Version
The static analysis also flags that “docker/build-push-action@v2” is outdated. Using a more recent version (such as v4) should enhance stability and compatibility. Consider updating as follows:

-        uses: docker/build-push-action@v2
+        uses: docker/build-push-action@v4
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Build and push Docker image
id: push
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: |
latest
${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Build and push Docker image
id: push
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: |
latest
${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
🧰 Tools
🪛 actionlint (1.7.4)

35-35: the runner of "docker/build-push-action@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

- name: Generate artifact attestation
uses: actions/attest-build-provenance@v2
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# File Created: 2025-03-05 11:10:40
#
# Modified By: mingcheng ([email protected])
# Last Modified: 2025-03-05 17:42:51
# Last Modified: 2025-03-17 18:29:18
##

name: Cargo Build & Test
Expand Down
Loading