From 63cc12442a3ac63c85c1f1febe2f1173c71501cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matou=C5=A1=20Dzivjak?= Date: Wed, 6 Mar 2024 21:27:19 +0100 Subject: [PATCH] feat(ci): deploy using fly --- .github/workflows/ci.yaml | 30 +++++++++++------------------- Cargo.toml | 8 -------- Dockerfile | 2 +- rust-toolchain.toml | 2 +- 4 files changed, 13 insertions(+), 29 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9b2b8d1..0b5cdfc 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -49,7 +49,7 @@ jobs: - name: Run cargo test run: cargo test --workspace - lints: + lint: name: Lints runs-on: ubuntu-latest steps: @@ -82,27 +82,19 @@ jobs: permissions: contents: read packages: write + needs: [check, test, lint] steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v4 - - name: Log in to the Container registry - uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + - name: Checkout repository + uses: actions/checkout@v4 with: - registry: ${{ env.REGISTRY }} - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + repository: matoous/wiki + path: wiki - - name: Extract metadata (tags, labels) for Docker - id: meta - uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + - uses: superfly/flyctl-actions/setup-flyctl@master - - name: Build and push Docker image - uses: docker/build-push-action@831ca179d3cf91cf0c90ca465a408fa61e2129a2 - with: - context: . - push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} + - run: flyctl deploy + env: + FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} diff --git a/Cargo.toml b/Cargo.toml index c5db42f..f0666ba 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,14 +13,6 @@ default-members = [ [profile.release] lto = "thin" -# debug = true - -[profile.opt] -inherits = "release" -lto = "fat" -codegen-units = 1 -# strip = "debuginfo" # TODO: or strip = true -opt-level = 3 [workspace.package] name = "mwp" diff --git a/Dockerfile b/Dockerfile index 0d70fd5..3c23519 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM rust:1.74-slim-bookworm as builder +FROM rust:1.74.1-slim as builder RUN apt update \ && apt install -y libssl-dev pkg-config diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 7c7cb7f..673fd95 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.74.0" +channel = "1.74.1" components = ["rustfmt", "rust-src", "clippy"]