Skip to content

Commit

Permalink
feat: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
kirinnee committed Dec 13, 2023
0 parents commit 2d50c39
Show file tree
Hide file tree
Showing 53 changed files with 4,875 additions and 0 deletions.
710 changes: 710 additions & 0 deletions .dockerignore

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
nix_direnv_watch_file "./nix/env.nix" "./nix/fmt.nix" "./nix/packages.nix" "./nix/shells.nix" "./nix/pre-commit.nix" "./flake.nix" "./parse.nix"
use flake
PATH_add node_modules/.bin
pls setup
14 changes: 14 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
- package-ecosystem: docker
directory: /
schedule:
interval: daily
- package-ecosystem: npm
directory: /
schedule:
interval: daily
107 changes: 107 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: CI-CD

on:
push:

env:
# Docker
DOCKER_DOMAIN: ghcr.io
DOCKER_USER: ${{ github.actor }}
DOCKER_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
DOCKER_LATEST_BRANCH: main

DOCKER_CACHE_KEY_ID: ${{ secrets.R2_KEY_ID }}
DOCKER_CACHE_KEY_SECRET: ${{ secrets.R2_KEY_SECRET }}
DOCKER_CACHE_URL: "https://9f21cac25548ad04899fc78c8101e7de.r2.cloudflarestorage.com"
DOCKER_CACHE_BUCKET: "ci-cache"
DOCKER_CACHE_REGION: "APAC"

# Helm

jobs:
precommit:
name: Pre-commit Check
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- name: Run pre-commit
run: nix develop .#ci -c ./scripts/ci/pre-commit.sh
build:
name: Build Docker
runs-on: ubuntu-22.04
strategy:
matrix:
configs:
- image-name: nitroso-helium-arm
dockerfile: Dockerfile
context: .
platform: linux/arm64
- image-name: nitroso-helium-amd
dockerfile: Dockerfile
context: .
platform: linux/amd64
env:
STRAT_DOCKER_IMAGE: ${{ matrix.configs.image-name }}
STRAT_DOCKERFILE: ${{ matrix.configs.dockerfile }}
STRAT_DOCKER_CONTEXT: ${{ matrix.configs.context }}
STRAT_DOCKER_PLATFORM: ${{ matrix.configs.platform }}
steps:
- uses: actions/checkout@v4
- uses: rlespinasse/github-slug-action@v3.x
- uses: docker/setup-buildx-action@v3
- uses: docker/setup-qemu-action@v3
- name: Build and Push Docker
run: ./scripts/ci/ci-docker.sh
env:
CI_DOCKER_IMAGE: ${{ env.STRAT_DOCKER_IMAGE }}
CI_DOCKER_CONTEXT: ${{ env.STRAT_DOCKER_CONTEXT }}
CI_DOCKERFILE: ${{ env.STRAT_DOCKERFILE }}
CI_DOCKER_PLATFORM: ${{ env.STRAT_DOCKER_PLATFORM }}

DOMAIN: ${{ env.DOCKER_DOMAIN }}

GITHUB_REPO_REF: ${{ github.repository }}
GITHUB_SHA: ${{ github.sha }}
GITHUB_BRANCH: ${{ env.GITHUB_REF_SLUG }}

DOCKER_PASSWORD: ${{ env.DOCKER_PASSWORD }}
DOCKER_USER: ${{ env.DOCKER_USER }}

S3_KEY_ID: ${{ env.DOCKER_CACHE_KEY_ID }}
S3_KEY_SECRET: ${{ env.DOCKER_CACHE_KEY_SECRET }}
S3_URL: ${{ env.DOCKER_CACHE_URL }}
S3_BUCKET: ${{ env.DOCKER_CACHE_BUCKET }}
S3_REGION: ${{ env.DOCKER_CACHE_REGION }}

LATEST_BRANCH: ${{ env.DOCKER_LATEST_BRANCH}}

release:
name: Semantic Release
needs:
- precommit
- build
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- uses: rlespinasse/github-slug-action@v3.x

- name: Release
env:
GITHUB_REPO_REF: ${{ github.repository }}
GITHUB_SHA: ${{ github.sha }}
GITHUB_BRANCH: ${{ env.GITHUB_REF_SLUG_URL }}
CI_DOCKER_IMAGES: "nitroso-helium-arm,nitroso-helium-amd"

GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

DOMAIN: ${{ env.DOCKER_DOMAIN }}

DOCKER_PASSWORD: ${{ env.DOCKER_PASSWORD }}
DOCKER_USER: ${{ env.DOCKER_USER }}

run: nix develop .#releaser -c scripts/ci/release.sh
Loading

0 comments on commit 2d50c39

Please sign in to comment.