generated from alecodes/base-template
Compare commits
No commits in common. "e379967907d76c52ef3b1d55c6611269cb7be21b" and "5bd421f12b25eeeef9b9f23220238f3f8647cfd6" have entirely different histories.
e379967907
...
5bd421f12b
3 changed files with 96 additions and 23 deletions
92
.forgejo/workflows/build-image.yaml
Normal file
92
.forgejo/workflows/build-image.yaml
Normal file
|
|
@ -0,0 +1,92 @@
|
||||||
|
name: Publish image
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
bump-crate:
|
||||||
|
runs-on: rust
|
||||||
|
steps:
|
||||||
|
- run: cargo install cargo-bump
|
||||||
|
- name: Bump version and publish
|
||||||
|
uses: https://github.com/cocogitto/cocogitto-action@v3.10
|
||||||
|
env:
|
||||||
|
NPM_REGISTRY_TOKEN: ${{ secrets.NPM_TOKEN_FORGEJO }}
|
||||||
|
with:
|
||||||
|
release: true
|
||||||
|
check-latest-tag-only: true
|
||||||
|
git-user: 'Cog Bot'
|
||||||
|
git-user-email: 'cog@alecodes.page'
|
||||||
|
|
||||||
|
|
||||||
|
create-docker-images:
|
||||||
|
runs-on: host
|
||||||
|
needs:
|
||||||
|
- bump-crate
|
||||||
|
steps:
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Login to Docker Hub
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: git.alecodes.page
|
||||||
|
username: ${{ vars.CONTAINER_REGISTRY_USER }}
|
||||||
|
password: ${{ secrets.CONTAINER_REGISTRY_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and push
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
platforms: linux/amd64
|
||||||
|
push: true
|
||||||
|
outputs: |
|
||||||
|
type=local,dest=./build-out
|
||||||
|
type=docker
|
||||||
|
tags: |
|
||||||
|
git.alecodes.page/alecodes/compendium:latest
|
||||||
|
git.alecodes.page/alecodes/compendium:${{ github.sha }}
|
||||||
|
|
||||||
|
# - uses: actions/upload-artifact@v3
|
||||||
|
# with:
|
||||||
|
# name: my-artifact
|
||||||
|
# path: ./build-out/app
|
||||||
|
#
|
||||||
|
# deploy:
|
||||||
|
# runs-on: ubuntu-latest
|
||||||
|
# needs:
|
||||||
|
# - create-docker-images
|
||||||
|
# steps:
|
||||||
|
# - uses: actions/download-artifact@v3
|
||||||
|
# - name: Display structure of downloaded files
|
||||||
|
# run: ls -R
|
||||||
|
# - name: Publish release
|
||||||
|
# uses: https://code.forgejo.org/actions/forgejo-release@v2.5.0
|
||||||
|
# with:
|
||||||
|
# url: "https://git.alecodes.page"
|
||||||
|
# repo: "alecodes/compendium"
|
||||||
|
# direction: upload
|
||||||
|
# # tag: "${{ github.ref_name }}"
|
||||||
|
# sha: "${{ github.sha }}"
|
||||||
|
# release-dir: .
|
||||||
|
# # token: ${{ secrets.TOKEN }}
|
||||||
|
# override: ${{ vars.OVERRIDE || "false" }}
|
||||||
|
# verbose: ${{ vars.VERBOSE || "false" }}
|
||||||
|
|
||||||
|
# deploy:
|
||||||
|
# runs-on: ubuntu-latest
|
||||||
|
# needs:
|
||||||
|
# - create-docker-images
|
||||||
|
# steps:
|
||||||
|
# - name: Checkout code
|
||||||
|
# uses: actions/checkout@v4
|
||||||
|
# - name: 'Docker Stack Deploy'
|
||||||
|
# uses: https://github.com/cssnr/stack-deploy-action@v1
|
||||||
|
# with:
|
||||||
|
# host: ${{ vars.DOCKER_SWARM_HOST }}
|
||||||
|
# port: ${{ vars.DOCKER_SWARM_PORT }}
|
||||||
|
# user: ${{ secrets.DOCKER_SWARM_USER }}
|
||||||
|
# ssh_key: '${{ secrets.DOCKER_SWARM_SSH_KEY }}'
|
||||||
|
# file: 'docker-stack.yaml'
|
||||||
|
# name: 'personal_page'
|
||||||
25
.justfile
25
.justfile
|
|
@ -3,10 +3,7 @@ mod repo ".devfiles/justfile"
|
||||||
|
|
||||||
set dotenv-load := true
|
set dotenv-load := true
|
||||||
|
|
||||||
bin_name := "compendium"
|
|
||||||
release_mode := "dev"
|
release_mode := "dev"
|
||||||
container_registry := "git.alecodes.page/alecodes"
|
|
||||||
container_image_name := container_registry / bin_name
|
|
||||||
|
|
||||||
[private]
|
[private]
|
||||||
docker-compose +ARGS:
|
docker-compose +ARGS:
|
||||||
|
|
@ -14,6 +11,9 @@ docker-compose +ARGS:
|
||||||
|
|
||||||
start-dev-services: (docker-compose "up --remove-orphans")
|
start-dev-services: (docker-compose "up --remove-orphans")
|
||||||
|
|
||||||
|
dev:
|
||||||
|
watchexec --no-vcs-ignore --clear --restart --watch=dist --watch=src cargo run {{ if release_mode == "prod" { "--release" } else { "" } }}
|
||||||
|
|
||||||
kitty-dev:
|
kitty-dev:
|
||||||
kitten @ goto-layout tall
|
kitten @ goto-layout tall
|
||||||
kitten @ launch --cwd=current --dont-take-focus just build-frontend-watch
|
kitten @ launch --cwd=current --dont-take-focus just build-frontend-watch
|
||||||
|
|
@ -30,22 +30,3 @@ build-frontend-watch:
|
||||||
|
|
||||||
build-frontend:
|
build-frontend:
|
||||||
bun ./.devfiles/scripts/build-frontend.ts
|
bun ./.devfiles/scripts/build-frontend.ts
|
||||||
|
|
||||||
build:
|
|
||||||
podman build --tag {{ container_image_name }}:latest --cache-to {{ container_image_name }}-cache --cache-from {{ container_image_name }}-cache .
|
|
||||||
|
|
||||||
dev:
|
|
||||||
watchexec --no-vcs-ignore --clear --restart --watch=dist --watch=src cargo run {{ if release_mode == "prod" { "--release" } else { "" } }}
|
|
||||||
|
|
||||||
test:
|
|
||||||
cargo test
|
|
||||||
|
|
||||||
publish: (build)
|
|
||||||
podman push {{ container_image_name }}:latest
|
|
||||||
podman push {{ container_image_name }}:latest {{ container_image_name }}:$(git rev-parse --short HEAD)
|
|
||||||
|
|
||||||
deploy:
|
|
||||||
|
|
||||||
clean:
|
|
||||||
podman system prune --build
|
|
||||||
cargo clean
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
# ── Javascript ──────────────────────────────────────────────────────────
|
# ── Javascript ──────────────────────────────────────────────────────────
|
||||||
|
|
||||||
FROM docker.io/oven/bun:1 AS bun
|
FROM oven/bun:1 AS bun
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
|
|
||||||
# install dependencies into temp directory
|
# install dependencies into temp directory
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue