Merge pull request #15 from beat-forge/dependabot/cargo/serde-1.0.180 #72
This file contains 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
on: [push] | |
name: Build and Test | |
env: | |
SCCACHE_GHA_ENABLED: "true" | |
RUSTC_WRAPPER: "sccache" | |
jobs: | |
build: | |
name: Build and Publish | |
runs-on: self-hosted | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- uses: actions/checkout@v3 | |
# login to ghcr.io | |
- uses: docker/login-action@v2 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
# install rust | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
# caching | |
- uses: mozilla-actions/[email protected] | |
- name: Rust Cache | |
uses: Swatinem/rust-cache@v2 | |
# test and build | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --release | |
- uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
args: --all --release | |
# publish to ghcr.io and publish artifact | |
- uses: docker/build-push-action@v4 | |
with: | |
context: . | |
file: ./Dockerfile | |
push: true | |
tags: ghcr.io/beat-forge/api:latest | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: api-linux-amd64 | |
path: target/release/api |