Skip to content

Merge pull request #55 from SynixeContractors/dependabot/github_actio… #66

Merge pull request #55 from SynixeContractors/dependabot/github_actio…

Merge pull request #55 from SynixeContractors/dependabot/github_actio… #66

Workflow file for this run

name: api
on:
push:
branches: [main]
paths:
- .github/workflows/api.yaml
- Cargo.toml
- bin/api/**
- lib/**
permissions:
packages: write
contents: read
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install Protoc
run: |
sudo apt-get update
sudo apt-get install -y protobuf-compiler
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: Swatinem/rust-cache@v2
with:
key: api
- run: cargo build --release
working-directory: ./bin/api
- run: cp target/release/synixe-api ./bin/api/synixe-api
- name: Build Image
working-directory: ./bin/api
run: docker build . -t api
- name: Tag Image
run: docker tag api ghcr.io/synixecontractors/apps-api:latest
- name: Push Image
run: docker push ghcr.io/synixecontractors/apps-api:latest