Skip to content

Commit

Permalink
feat(app): add simple dockerization
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcnk committed Aug 11, 2024
1 parent 52de83c commit fc7ef5d
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/dockerize.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Dockerize latest version
on:
workflow_dispatch:
jobs:
dockerize_and_push:
name: Dockerize and push to GHCR
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- uses: actions/checkout@v4
- name: Install Nixpacks
run: |
curl -LO https://github.com/railwayapp/nixpacks/releases/download/v1.26.0/nixpacks-v1.26.0-amd64.deb
sudo dpkg -i nixpacks-v1.26.0-amd64.deb
# - name: Copy .env
# run: cp .env.example .env
- name: Build image
run: nixpacks build .
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Tag image
run: docker tag $(docker images --format='{{.ID}}' | head -1) ghcr.io/mrcnk/faasade:$(git rev-parse --short HEAD)
- name: Push to GHCR
run: docker push ghcr.io/mrcnk/faasade:$(git rev-parse --short HEAD)
19 changes: 19 additions & 0 deletions .github/workflows/promote.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Promote Docker image to latest
on:
workflow_dispatch:
jobs:
dockerize_and_push:
name: Tag latest and push to GHCR
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- uses: actions/checkout@v4
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Tag image
run: docker buildx imagetools create ghcr.io/mrcnk/faasade:$(git rev-parse --short HEAD) --tag ghcr.io/mrcnk/faasade:latest
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,8 @@ Whatever the code in the file returns. If it's a valid JSON, it's gonna be parse
- [ ] Consider sandboxing the code execution.
- [ ] Add /gist/:gistId route to list all the runnable files in the Gist.
- [ ] Add more tests.

## Credits

- [tinypool](https://github.com/tinylibs/tinypool) - A tiny Node.js Worker Thread Pool.
- [Hono](https://hono.dev) - Web application framework.

0 comments on commit fc7ef5d

Please sign in to comment.