Compare commits
3 Commits
Author | SHA1 | Date | |
---|---|---|---|
758fa7608f | |||
ee6b947f29 | |||
18dd1ef528 |
38
.github/workflows/build.yml
vendored
38
.github/workflows/build.yml
vendored
@@ -20,6 +20,8 @@ jobs:
|
||||
detect-project:
|
||||
name: Detect Rust Project
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
RUNNER_TOOL_CACHE: /toolcache
|
||||
outputs:
|
||||
project-dir: ${{ steps.detect.outputs.project-dir }}
|
||||
project-name: ${{ steps.detect.outputs.project-name }}
|
||||
@@ -56,6 +58,8 @@ jobs:
|
||||
needs: [detect-project]
|
||||
if: ${{ !failure() && !cancelled() }}
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
RUNNER_TOOL_CACHE: /toolcache
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
@@ -79,6 +83,8 @@ jobs:
|
||||
set-tag:
|
||||
name: Set Tag Name
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
RUNNER_TOOL_CACHE: /toolcache
|
||||
outputs:
|
||||
tag_name: ${{ steps.set_tag.outputs.tag_name }}
|
||||
steps:
|
||||
@@ -139,6 +145,8 @@ jobs:
|
||||
needs: [detect-project, test]
|
||||
if: ${{ !failure() && !cancelled() }}
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
RUNNER_TOOL_CACHE: /toolcache
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
@@ -189,30 +197,6 @@ jobs:
|
||||
path: |
|
||||
${{ needs.detect-project.outputs.project-dir }}/target/${{ matrix.target }}/release/${{ needs.detect-project.outputs.project-name }}${{ matrix.os == 'windows' && '.exe' || '' }}
|
||||
|
||||
- name: Build documentation
|
||||
working-directory: ${{ needs.detect-project.outputs.project-dir }}
|
||||
run: |
|
||||
cargo doc --no-deps --all-features
|
||||
echo "Documentation built in: $PWD/target/doc"
|
||||
ls -la target/doc/
|
||||
|
||||
- name: Prepare documentation for deployment
|
||||
working-directory: ${{ needs.detect-project.outputs.project-dir }}
|
||||
run: |
|
||||
# Create a temporary directory for deployment
|
||||
mkdir -p ../docs-deploy
|
||||
cp -r target/doc/* ../docs-deploy/
|
||||
|
||||
# Create redirect index if needed
|
||||
echo '<meta http-equiv="refresh" content="0; url=${{ needs.detect-project.outputs.project-name }}/index.html">' > ../docs-deploy/index.html
|
||||
|
||||
- name: Deploy to GitHub Pages
|
||||
uses: peaceiris/actions-gh-pages@v3
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
publish_dir: ../docs-deploy
|
||||
publish_branch: gh-pages
|
||||
force_orphan: true
|
||||
docker-build:
|
||||
name: Build and Push Docker Image
|
||||
needs: [detect-project, build, set-tag]
|
||||
@@ -222,6 +206,8 @@ jobs:
|
||||
needs.build.result == 'success' &&
|
||||
github.event_name != 'pull_request'
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
RUNNER_TOOL_CACHE: /toolcache
|
||||
environment: production
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
@@ -261,6 +247,8 @@ jobs:
|
||||
github.event_name == 'push' &&
|
||||
needs.docker-build.result == 'success'
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
RUNNER_TOOL_CACHE: /toolcache
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
@@ -281,7 +269,7 @@ jobs:
|
||||
|
||||
summary:
|
||||
name: Workflow Summary
|
||||
needs: [test, audit, build, docker-build]
|
||||
needs: [test, build, docker-build]
|
||||
if: always()
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
@@ -56,7 +56,7 @@ pub async fn get_available_container(docker: &Docker) -> Vec<DockerContainer> {
|
||||
})
|
||||
.unwrap_or_else(|| "unknown".to_string());
|
||||
|
||||
println!(" - ID: {}, Image: {:?}, Name: {}", short_id, container.image, name);
|
||||
println!(" - ID: {}, Image: {}, Name: {}", short_id, container.image.unwrap(), name);
|
||||
|
||||
Some(DockerContainer {
|
||||
ID: short_id.to_string(),
|
||||
|
Reference in New Issue
Block a user