Skip to content

Commit cd006be

Browse files
refactor: streamline CI/CD workflow by removing musl target and enhancing Docker build steps (#16)
1 parent 37dc168 commit cd006be

1 file changed

Lines changed: 15 additions & 9 deletions

File tree

‎.github/workflows/ci-cd.yaml‎

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,8 @@ jobs:
2323
# packages: musl-dev
2424
# version: 1.0
2525

26-
- name: Add musl target
27-
run: rustup target add x86_64-unknown-linux-musl
28-
2926
- name: Cache Rust dependencies
3027
uses: Swatinem/rust-cache@v2
31-
with:
32-
cache-directories: ~/.rustup
3328

3429
- name: Format
3530
run: cargo fmt --all -- --check
@@ -46,7 +41,18 @@ jobs:
4641
- name: Verify Documentation
4742
run: cargo doc --no-deps --all-features --document-private-items
4843

49-
publish:
44+
- name: Set up Docker Buildx
45+
uses: docker/setup-buildx-action@v3
46+
47+
- name: Build Docker image
48+
uses: docker/build-push-action@v6
49+
with:
50+
context: .
51+
push: false
52+
cache-from: type=gha
53+
cache-to: type=gha,mode=max
54+
55+
publish-docker:
5056
name: Publish Docker image
5157
needs: ci
5258
if: github.ref_name == 'main' && github.event_name == 'push'
@@ -74,9 +80,9 @@ jobs:
7480
cache-from: type=gha
7581
cache-to: type=gha,mode=max
7682

77-
deploy:
78-
name: Deploy to production
79-
needs: publish
83+
deploy-docker:
84+
name: Deploy Docker image to Production Server
85+
needs: publish-docker
8086
if: github.ref_name == 'main' && github.event_name == 'push'
8187
runs-on: ubuntu-latest
8288
environment: production

0 commit comments

Comments
 (0)