Skip to content

Commit

Permalink
Add alerts
Browse files Browse the repository at this point in the history
  • Loading branch information
marshallku committed Feb 3, 2025
1 parent 8995cc1 commit 63c6851
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 71 deletions.
38 changes: 0 additions & 38 deletions .github/workflows/ci.yml

This file was deleted.

33 changes: 2 additions & 31 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,14 @@ name: Deploy to Container Registry

on:
push:
branches:
- master

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
IMAGE_NAME: marshallku/marshallku-blog-cdn

jobs:
create-tag-release:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.check.outputs.version }}
tag-exists: ${{ steps.create-tag-release.outputs.tag-exists }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check version
id: check
shell: bash
run: |
PPREVIOUS_VERSION=$(git show HEAD~1:Cargo.toml | grep version -m 1 | cut -d '"' -f 2)
CURRENT_VERSION=$(grep version Cargo.toml -m 1 | cut -d '"' -f 2)
if [ "$PPREVIOUS_VERSION" != "$CURRENT_VERSION" ]; then
echo "version=$CURRENT_VERSION" >> "$GITHUB_OUTPUT"
fi
- name: Create tag and release
id: create-tag-release
if: ${{ steps.check.outputs.version != '' }}
uses: marshallku/actions/create-tag-release@master
with:
tag: v${{ steps.check.outputs.version }}
push-image:
runs-on: ubuntu-latest
needs: ["create-tag-release"]
if: ${{ needs.create-tag-release.outputs.tag-exists == 'false' }}
permissions:
contents: read
packages: write
Expand All @@ -61,5 +32,5 @@ jobs:
with:
context: .
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:v${{ needs.create-tag-release.outputs.version }},${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:v1.1.4,${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
labels: ${{ steps.meta.outputs.labels }}
5 changes: 3 additions & 2 deletions src/log.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use axum::{body::Body, extract::Request};
use tracing::{info, Span};
use tracing::{error, info, Span};

pub fn trace_layer_on_request(request: &Request<Body>, _span: &Span) {
let user_agent = request
Expand All @@ -25,5 +25,6 @@ pub fn trace_layer_on_request(request: &Request<Body>, _span: &Span) {
info!(
"User-Agent: {:?} Referrer: {:?} IP: {:?}",
user_agent, referer, ip_address
)
);
error!("This package is deprecated, please use `ghcr.io/marshallku/rustyfiles:latest`: https://github.com/marshallku/rustyfiles");
}
1 change: 1 addition & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ async fn main() {
let listener = tokio::net::TcpListener::bind(addr.as_str()).await.unwrap();

info!("Server running at http://{}", addr);
error!("This package is deprecated, please use `ghcr.io/marshallku/rustyfiles:latest`: https://github.com/marshallku/rustyfiles");

axum::serve(listener, app.into_make_service())
.await
Expand Down

0 comments on commit 63c6851

Please sign in to comment.