diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index d4c53d6..bc59356 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -2,14 +2,14 @@ name: Docker Image CI on: push: - branches: [ "main" ] + branches: ["main"] jobs: - build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Build the Docker image - run: docker build . --tag cloudflare-dynamic-dns:$(date +%s) + - uses: actions/checkout@v3 + - name: Build the Docker image + run: docker build . --tag ghcr.io/azoth128/cloudflare-dynamic-dns:latest + run: docker push ghcr.io/azoth128/cloudflare-dynamic-dns:latest diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml deleted file mode 100644 index 58e7b53..0000000 --- a/.github/workflows/rust.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Rust - -on: - push: - branches: ["main"] - -env: - CARGO_TERM_COLOR: always - -jobs: - build: - runs-on: rust:1.70 - - steps: - - uses: actions/checkout@v3 - - name: Build - run: cargo build --release diff --git a/Dockerfile b/Dockerfile index 32c330b..a694584 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,9 @@ -FROM rust:1.70 - +FROM rust:1.70 as builder WORKDIR ./src/ COPY . . - RUN cargo install --path . +FROM debian:bullseye-slim +RUN apt-get update && rm -rf /var/lib/apt/lists/* +COPY --from=builder /usr/local/cargo/bin/cloudflare-dynamic-dns /usr/local/bin/cloudflare-dynamic-dns CMD ["cloudflare-dynamic-dns"] \ No newline at end of file