diff --git a/.github/workflows/deploy-image.yml b/.github/workflows/deploy-image.yml new file mode 100644 index 0000000..c98a2ed --- /dev/null +++ b/.github/workflows/deploy-image.yml @@ -0,0 +1,50 @@ +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +# GitHub recommends pinning actions to a commit SHA. +# To get a newer version, you will need to update the SHA. +# You can also reference a tag or branch, but the action may change without warning. + +name: Create and publish a Docker image + +on: + push: + branches: ['master'] + +env: + REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} + +jobs: + build-and-push-image: + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Log in to the Container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Build and push Docker image + uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..a28ee91 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2023 Ronald Cantillo + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md index 40bde5d..3903f86 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,77 @@ Web app similar to LinkTree using information from GitHub profile. > From [simplesite template](https://github.com/tataraba/simplesite) +![ShowCase](showcase.png) + ## ๐Ÿงช Try it out -- [https://ghtree.fly.dev/](https://ghtree.fly.dev/) +> It may take a few seconds to load the first time. + +### [https://ghtree.fly.dev/](https://ghtree.fly.dev/) + +## ๐Ÿš€ Deploy + +You can run your own instance locally or deploy it to a serverless platform like [Fly.io](https://fly.io/). + +### -> Locally + +There are two ways to run the app locally, using Docker or Python. + +#### ๐Ÿณ Docker (recommended) + +```sh +docker run --rm -p 8000:8000 ghcr.io/rooyca/ghtree:latest +``` + +You could also build the image yourself. + +```sh +docker build -t ghtree . +docker run --rm -p 8000:8000 ghtree +``` + +There are three Dockerfiles, one with full `python` image, one with `python:slim` and one with `python:alpine`. You can use the one that suits you best. For example, if you want to use the `slim` version, you can do: + +```sh +docker build -t ghtree -f Dockerfile.slim . +docker run --rm -p 8000:8000 ghtree +``` + +Although I recommend using the [alpine version](Dockerfile), since it is the smallest one. Let's look at the size of each image. + +| Dockerfile | Size | +| --- | --- | +| [Dockerfile (alpine)](Dockerfile) | 163 MB | +| [Dockerfile.slim](Dockerfile.slim) | 562 MB | +| [Dockerfile.full](Dockerfile.full) | +1 GB | + + +#### ๐Ÿ Python + +```sh +pip install -r requirements.txt +python -m uvicorn app.main:app --reload +``` + +### -> Serverless + +You can deploy the app to any serverless platform that supports Python apps, like [Fly](https://fly.io/) or any other. + +#### ๐Ÿฆ‹ Fly.io + +```sh +fly launch +fly deploy +``` + +## ๐Ÿ› ๏ธ Build with + +- [FastAPI](https://fastapi.tiangolo.com/) +- [TailwindCSS](https://tailwindcss.com/) +- [HTMX](https://htmx.org/) +- [GitHub API](https://docs.github.com/en/rest) +- [Font Awesome](https://fontawesome.com/) + +## ๐Ÿ“„ License -## ๐Ÿšง README under construction ๐Ÿšง \ No newline at end of file +[MIT](LICENSE) \ No newline at end of file diff --git a/showcase.png b/showcase.png new file mode 100644 index 0000000..1cf3c6c Binary files /dev/null and b/showcase.png differ