Skip to content

Commit

Permalink
add support for docker deployments
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelcmtd committed Feb 14, 2024
1 parent fbe0f05 commit c391269
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Publish a new Docker image

on:
push:
branches: [master]

jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: docker/build-push-action@v5
with:
push: true
context: .
platforms: linux/amd64,linux/arm64
tags: chrissx/jana:latest
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM dart:stable AS build

WORKDIR /app
COPY pubspec.yaml .
RUN dart pub get
COPY bin ./bin
RUN dart compile exe bin/jana.dart -o bin/app

FROM scratch
COPY --from=build /runtime/ /
COPY --from=build /app/bin/app /app/bin/

ENV JANA_DISCORD_TOKEN=

CMD ["/app/bin/app"]

0 comments on commit c391269

Please sign in to comment.