Compare commits
43 Commits
feat/ci-cd
...
87456e3aac
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
87456e3aac | ||
| d7249088e9 | |||
|
|
59ea9557d1 | ||
| 628c090dfd | |||
|
|
9fc42b7881 | ||
|
|
ce3ac3dfc0 | ||
|
|
75bc10fe3c | ||
|
|
d821302439 | ||
|
|
8eb116a9a1 | ||
|
|
038ea22068 | ||
|
|
c236059ce1 | ||
|
|
67f8881b3c | ||
|
|
1df4bb15a8 | ||
|
|
ddabcf19d1 | ||
|
|
9c8ceba461 | ||
|
|
384f985a77 | ||
|
|
5b56a2c219 | ||
|
|
97638b888e | ||
|
|
6852a79f87 | ||
|
|
a561b184e1 | ||
|
|
7864c07be1 | ||
|
|
1e38d69b21 | ||
|
|
eb9e669233 | ||
|
|
13db5ce5f1 | ||
|
|
babfccaa1b | ||
|
|
1aa29dfb31 | ||
|
|
efb55bc784 | ||
|
|
9cdb2cf427 | ||
|
|
135b88029a | ||
|
|
23df7feaf1 | ||
|
|
2e2832b1e3 | ||
|
|
dd846bc86a | ||
|
|
25e9177554 | ||
|
|
cfd1561de9 | ||
|
|
6304d14e56 | ||
|
|
e4fe42c6ec | ||
|
|
27a9900787 | ||
|
|
90cbff0611 | ||
|
|
ddae05dc3f | ||
|
|
12fa36a7b0 | ||
|
|
fc7d92e33f | ||
|
|
8f941381f9 | ||
|
|
83b48cb3be |
@@ -6,6 +6,7 @@ planning
|
||||
deploy
|
||||
infra
|
||||
packages/admin
|
||||
!packages/admin/package.json
|
||||
Dockerfile*
|
||||
docker-compose*
|
||||
*.md
|
||||
|
||||
@@ -5,10 +5,18 @@ on:
|
||||
branches: [main]
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: build
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
if: "!startsWith(github.event.head_commit.message, 'chore: bump version')"
|
||||
env:
|
||||
REGISTRY: git2.lunarfront.tech
|
||||
GIT_REMOTE: git2.lunarfront.tech
|
||||
DOCKER_HOST: tcp://localhost:2375
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
@@ -45,27 +53,8 @@ jobs:
|
||||
")
|
||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Commit version bump
|
||||
run: |
|
||||
git config user.name "lunarfront-bot"
|
||||
git config user.email "bot@lunarfront.tech"
|
||||
git remote set-url origin https://lunarfront-bot:${{ secrets.BOT_TOKEN }}@git.lunarfront.tech/ryan/lunarfront-app.git
|
||||
git add packages/backend/package.json
|
||||
git commit -m "chore: bump version to v${{ steps.version.outputs.version }}"
|
||||
git push origin main
|
||||
|
||||
- name: Install Docker CLI
|
||||
run: |
|
||||
apt-get update -qq
|
||||
apt-get install -y ca-certificates curl
|
||||
install -m 0755 -d /etc/apt/keyrings
|
||||
curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
|
||||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian $(. /etc/os-release && echo $VERSION_CODENAME) stable" > /etc/apt/sources.list.d/docker.list
|
||||
apt-get update -qq
|
||||
apt-get install -y docker-ce-cli
|
||||
|
||||
- name: Login to registry
|
||||
run: echo "${{ secrets.REGISTRY_TOKEN }}" | docker login registry.lunarfront.tech -u ryan --password-stdin
|
||||
run: echo "${{ secrets.REGISTRY_TOKEN }}" | docker login $REGISTRY -u ryan --password-stdin
|
||||
|
||||
- name: Build and push backend
|
||||
run: |
|
||||
@@ -73,27 +62,37 @@ jobs:
|
||||
SHA=$(git rev-parse --short HEAD)
|
||||
docker build \
|
||||
--build-arg APP_VERSION=$VERSION \
|
||||
-t registry.lunarfront.tech/ryan/lunarfront-app:$VERSION \
|
||||
-t registry.lunarfront.tech/ryan/lunarfront-app:$SHA \
|
||||
-t registry.lunarfront.tech/ryan/lunarfront-app:latest \
|
||||
-t $REGISTRY/ryan/lunarfront-app:$VERSION \
|
||||
-t $REGISTRY/ryan/lunarfront-app:$SHA \
|
||||
-t $REGISTRY/ryan/lunarfront-app:latest \
|
||||
-f Dockerfile .
|
||||
docker push registry.lunarfront.tech/ryan/lunarfront-app:$VERSION
|
||||
docker push registry.lunarfront.tech/ryan/lunarfront-app:$SHA
|
||||
docker push registry.lunarfront.tech/ryan/lunarfront-app:latest
|
||||
docker push $REGISTRY/ryan/lunarfront-app:$VERSION
|
||||
docker push $REGISTRY/ryan/lunarfront-app:$SHA
|
||||
docker push $REGISTRY/ryan/lunarfront-app:latest
|
||||
|
||||
- name: Build and push frontend
|
||||
run: |
|
||||
VERSION=${{ steps.version.outputs.version }}
|
||||
SHA=$(git rev-parse --short HEAD)
|
||||
docker build \
|
||||
-t registry.lunarfront.tech/ryan/lunarfront-frontend:$VERSION \
|
||||
-t registry.lunarfront.tech/ryan/lunarfront-frontend:$SHA \
|
||||
-t registry.lunarfront.tech/ryan/lunarfront-frontend:latest \
|
||||
-t $REGISTRY/ryan/lunarfront-frontend:$VERSION \
|
||||
-t $REGISTRY/ryan/lunarfront-frontend:$SHA \
|
||||
-t $REGISTRY/ryan/lunarfront-frontend:latest \
|
||||
-f Dockerfile.frontend .
|
||||
docker push registry.lunarfront.tech/ryan/lunarfront-frontend:$VERSION
|
||||
docker push registry.lunarfront.tech/ryan/lunarfront-frontend:$SHA
|
||||
docker push registry.lunarfront.tech/ryan/lunarfront-frontend:latest
|
||||
docker push $REGISTRY/ryan/lunarfront-frontend:$VERSION
|
||||
docker push $REGISTRY/ryan/lunarfront-frontend:$SHA
|
||||
docker push $REGISTRY/ryan/lunarfront-frontend:latest
|
||||
|
||||
- name: Commit version bump
|
||||
run: |
|
||||
git config user.name "lunarfront-bot"
|
||||
git config user.email "bot@lunarfront.tech"
|
||||
git remote set-url origin https://lunarfront-bot:${{ secrets.BOT_TOKEN }}@$GIT_REMOTE/ryan/lunarfront-app.git
|
||||
git add packages/backend/package.json
|
||||
git commit -m "chore: bump version to v${{ steps.version.outputs.version }}"
|
||||
git pull --rebase origin main
|
||||
git push origin main
|
||||
|
||||
- name: Logout
|
||||
if: always()
|
||||
run: docker logout registry.lunarfront.tech
|
||||
run: docker logout $REGISTRY
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
workflow_dispatch:
|
||||
@@ -32,6 +30,8 @@ jobs:
|
||||
e2e:
|
||||
runs-on: ubuntu-latest
|
||||
needs: ci
|
||||
env:
|
||||
DOCKER_HOST: tcp://localhost:2375
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
|
||||
@@ -3,6 +3,7 @@ WORKDIR /app
|
||||
COPY package.json bun.lock ./
|
||||
COPY packages/shared/package.json packages/shared/
|
||||
COPY packages/backend/package.json packages/backend/
|
||||
COPY packages/admin/package.json packages/admin/
|
||||
RUN bun install --frozen-lockfile
|
||||
|
||||
FROM oven/bun:1.3.11-alpine AS build
|
||||
|
||||
@@ -3,6 +3,7 @@ WORKDIR /app
|
||||
COPY package.json bun.lock ./
|
||||
COPY packages/shared/package.json packages/shared/
|
||||
COPY packages/admin/package.json packages/admin/
|
||||
COPY packages/backend/package.json packages/backend/
|
||||
RUN bun install --frozen-lockfile
|
||||
|
||||
FROM oven/bun:1.3.11-alpine AS build
|
||||
|
||||
@@ -6,6 +6,7 @@ planning
|
||||
deploy
|
||||
infra
|
||||
packages/backend
|
||||
!packages/backend/package.json
|
||||
Dockerfile*
|
||||
docker-compose*
|
||||
*.md
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@lunarfront/backend",
|
||||
"version": "0.0.1",
|
||||
"version": "0.0.25",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user