Skip to content

ci: fix ci

ci: fix ci #56

Workflow file for this run

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
# cache with sccache
- name: Cache
uses:
mozilla-actions/[email protected]
# 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
# 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/gql-api