bkapi/.github/workflows/release.yml

43 lines
1.0 KiB
YAML
Raw Normal View History

2021-12-09 04:31:29 +00:00
name: Release
on:
push:
2023-02-11 03:00:42 +00:00
tags:
- "*"
2021-12-09 04:31:29 +00:00
env:
CARGO_TERM_COLOR: always
jobs:
release:
2023-02-11 03:00:42 +00:00
runs-on: ubuntu-latest
2021-12-09 04:31:29 +00:00
steps:
2023-02-11 03:00:42 +00:00
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
2021-12-09 04:31:29 +00:00
- name: Build binaries
run: |
2023-02-11 03:07:02 +00:00
sudo apt-get install protobuf-compiler
2023-02-11 03:00:42 +00:00
cargo build --release --bin bkapi
2021-12-09 04:31:29 +00:00
mv target/release/bkapi bkapi/bkapi
- name: Login to GitHub Container Registry
2023-02-11 03:00:42 +00:00
uses: docker/login-action@v2
2021-12-09 04:31:29 +00:00
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata for Docker
id: meta
2023-02-11 03:00:42 +00:00
uses: docker/metadata-action@v4
2021-12-09 04:31:29 +00:00
with:
images: ghcr.io/syfaro/bkapi
- name: Build and push Docker image
2023-02-11 03:00:42 +00:00
uses: docker/build-push-action@v4
2021-12-09 04:31:29 +00:00
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
file: bkapi/Dockerfile