Skip to content

Updated: updated workflow #2

Updated: updated workflow

Updated: updated workflow #2

Workflow file for this run

name: Rust CI/CD Pipeline
on:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
jobs:
build:
runs-on: self-hosted
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: Set up working directory
run: cd your_project_directory
- name: Install Dependencies
run: cargo fetch
working-directory: your_project_directory
- name: Run Tests
run: cargo test
working-directory: your_project_directory
- name: Build Project
run: cargo build --release
working-directory: your_project_directory
deploy:
runs-on: self-hosted
needs: build
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: Set up working directory
run: cd your_project_directory
- name: Install Dependencies
run: cargo fetch
working-directory: your_project_directory
- name: Build Project
run: cargo build --release
working-directory: your_project_directory
- name: Deploy to Production
run: |
# Add your deployment script/command here
echo "Deploying to production..."
working-directory: your_project_directory