feat: 0.0.23 #200
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
name: docker-ci | |
on: | |
push: | |
branches: [ main ] | |
tags: | |
- '*' | |
pull_request: | |
branches: [ main ] | |
concurrency: | |
group: ${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
ci: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Rust | |
uses: dsherret/rust-toolchain-file@v1 | |
- name: Rust Cache | |
uses: Swatinem/rust-cache@v2 | |
with: | |
cache-all-crates: true | |
- name: Install Protoc | |
uses: arduino/setup-protoc@v3 | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Check formatting | |
run: cargo fmt -- --check | |
- name: Check linting | |
run: cargo clippy --release --all-targets --all-features -- -D clippy::all | |
- name: Install SQLx CLI | |
run: cargo install sqlx-cli --no-default-features --features native-tls,postgres | |
- name: Check SQLx | |
working-directory: doseid | |
run: cargo sqlx prepare --check | |
cd: | |
needs: ci | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Docker Build | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: false | |
tags: doseiai/dosei | |
cache-from: type=gha | |
cache-to: type=gha,mode=max | |
load: true | |
- name: Docker Push | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: true | |
tags: | | |
doseiai/dosei | |
doseiai/dosei:${{ github.sha }} | |
cache-from: type=gha | |
- name: Docker Push Release | |
if: startsWith(github.ref, 'refs/tags/') | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
push: true | |
tags: | | |
doseiai/dosei | |
doseiai/dosei:${{ github.ref_name }} | |
cache-from: type=gha |