Build and Deploy #148
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Deploy | |
| on: | |
| push: | |
| tags: | |
| - 'v[0-9]+.[0-9]+.[0-9]+*' | |
| workflow_dispatch: | |
| env: | |
| CARGO_INCREMENTAL: 0 | |
| CARGO_NET_RETRY: 10 | |
| RUSTFLAGS: -Cdebuginfo=1 -Dwarnings | |
| jobs: | |
| build: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout project | |
| uses: actions/checkout@v3 | |
| - name: Install rust toolchain | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: stable | |
| profile: minimal | |
| override: true | |
| # See failed run <https://github.com/MaxOhn/Bathbot/actions/runs/13952289631/job/39054697734> | |
| - name: "Install fontconfig" | |
| run: sudo apt-get -y install libfontconfig1-dev jq | |
| - name: Cache dependencies | |
| uses: Swatinem/rust-cache@v1 | |
| - name: Build | |
| run: cargo build --release --features full | |
| - name: Deploy | |
| uses: appleboy/scp-action@v0.1.7 | |
| with: | |
| host: ${{ secrets.SCP_HOST }} | |
| username: ${{ secrets.SCP_USERNAME }} | |
| password: ${{ secrets.SCP_PASSWORD }} | |
| key: ${{ secrets.SCP_KEY }} | |
| source: target/release/bathbot-twilight | |
| target: ${{ secrets.SCP_TARGET }} | |
| strip_components: 2 |