Skip to content

Commit

Permalink
Adding github ci workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
codebanesr committed Nov 19, 2023
1 parent e6a9436 commit 778dae7
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 13 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: ci

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/${{ github.event.repository.name }}:latest
25 changes: 12 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
FROM rust:latest

RUN apt update && apt upgrade -y
RUN apt install -y g++-aarch64-linux-gnu libc6-dev-arm64-cross

RUN rustup target add aarch64-unknown-linux-gnu
RUN rustup toolchain install stable-aarch64-unknown-linux-gnu

WORKDIR /app

ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++

# Dockerfile
FROM rust:latest

WORKDIR /app

# Copy the source code into the container
COPY . .
CMD ["cargo", "build", "--target", "aarch64-unknown-linux-gnu"]

# Build the Rust application
RUN cargo build --release

# Set the entry point for the application
CMD ["./target/release/scanner"]

0 comments on commit 778dae7

Please sign in to comment.