Skip to content

Commit

Permalink
bump deps + use ghcr for images
Browse files Browse the repository at this point in the history
  • Loading branch information
jakewmeyer committed Sep 25, 2023
1 parent f37eff2 commit ecdb220
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 59 deletions.
28 changes: 22 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ on: [push, pull_request]
env:
IMAGE_NAME: sandbox-api
CARGO_TERM_COLOR: always
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}

jobs:
clippy:
Expand Down Expand Up @@ -52,12 +51,29 @@ jobs:
with:
command: test

deploy:
name: Deploy
push-image:
name: Push Image
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v3
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: flyctl deploy --local-only
- uses: actions/checkout@v3
- name: Build image
run: docker build . --file Dockerfile --tag $IMAGE_NAME
- name: Log into registry
run: echo ${{ secrets.PACKAGES_ACCESS_TOKEN }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
- name: Push image
run: |
IMAGE_ID=ghcr.io/${{ github.repository }}
# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Use Docker `latest` tag convention
[ "$VERSION" == "master" ] && VERSION=latest
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -89,4 +89,6 @@ $RECYCLE.BIN/
*.msp

# Windows shortcuts
*.lnk
*.lnk

.vscode
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ edition = "2021"

[dependencies]
anyhow = "1.0.75"
async-stripe = { version = "0.22.2", default-features = false, features = ["runtime-tokio-hyper-rustls", "billing", "connect", "webhook-events", "uuid", "stream", "checkout"] }
async-stripe = { version = "0.23.0", default-features = false, features = ["runtime-tokio-hyper-rustls", "billing", "connect", "webhook-events", "uuid", "stream", "checkout"] }
axum = { version = "0.6.20", features = ["http2", "headers"] }
chrono = { version = "0.4.30", features = ["serde"] }
chrono = { version = "0.4.31", features = ["serde"] }
dotenvy = "0.15.7"
figment = { version = "0.10.10", features = ["env"] }
jsonwebtoken = { version = "8.3.0", default-features = false }
owasp-headers = "0.1.2"
reqwest = { version = "0.11.20", default-features = false, features = ["rustls-tls", "trust-dns"] }
sea-orm = { version = "0.12.2", features = [ "sqlx-postgres", "runtime-tokio-rustls", "macros", "with-json", "with-chrono", "with-uuid" ] }
sea-orm = { version = "0.12.3", features = [ "sqlx-postgres", "runtime-tokio-rustls", "macros", "with-json", "with-chrono", "with-uuid" ] }
serde = { version = "1.0.188", features = ["derive"] }
serde_json = "1.0.106"
serde_json = "1.0.107"
serde_with = "3.3.0"
thiserror = "1.0.48"
tokio = { version = "1.32.0", features = ["full"] }
Expand Down
48 changes: 0 additions & 48 deletions fly.toml

This file was deleted.

0 comments on commit ecdb220

Please sign in to comment.