diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..a990b4f --- /dev/null +++ b/.github/workflows/main.yml @@ -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 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b43ccc2 --- /dev/null +++ b/Dockerfile @@ -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"]