Skip to content

Commit

Permalink
feat(ci): deploy using fly
Browse files Browse the repository at this point in the history
  • Loading branch information
matoous committed Mar 6, 2024
1 parent 802b12d commit 63cc124
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 29 deletions.
30 changes: 11 additions & 19 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
- name: Run cargo test
run: cargo test --workspace

lints:
lint:
name: Lints
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -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 }}
8 changes: 0 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "1.74.0"
channel = "1.74.1"
components = ["rustfmt", "rust-src", "clippy"]

0 comments on commit 63cc124

Please sign in to comment.