fix: update lockfile #3355
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI/CD | |
on: | |
push: | |
branches: | |
- mainnet | |
- testnet | |
- dev | |
pull_request: | |
branches-ignore: | |
- weblate-tr | |
env: | |
TURBO_TELEMETRY_DISABLED: 1 | |
jobs: | |
build_and_test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 2 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
- name: Install build libraries # https://github.com/Automattic/node-canvas?tab=readme-ov-file#compiling | |
run: sudo apt-get install -y libpango1.0-dev libcairo2-dev libpixman-1-dev pkg-config libgif-dev | |
- name: Cache turbo build setup | |
uses: actions/cache@v4 | |
with: | |
path: .turbo | |
key: ${{ runner.os }}-turbo-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-turbo- | |
- name: Setup Node.js environment | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
cache: 'pnpm' | |
- name: Install Dependencies | |
run: pnpm install | |
- name: Build Project | |
run: pnpm build | |
- name: Lint Code | |
run: pnpm lint | |
deploy: | |
needs: build_and_test | |
if: (github.event_name == 'push') && (github.ref == 'refs/heads/mainnet' || github.ref == 'refs/heads/testnet') | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
contents: read | |
steps: | |
- name: Checkout code | |
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: Install pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
run_install: false | |
- name: Cache turbo build setup | |
uses: actions/cache@v4 | |
with: | |
path: .turbo | |
key: ${{ runner.os }}-turbo-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-turbo- | |
- name: Install Dependencies | |
run: pnpm install | |
- name: Set Docker image metadata for api | |
uses: docker/metadata-action@v5 | |
id: meta-api | |
with: | |
images: ghcr.io/planb-network/blms-api | |
tags: | | |
type=schedule | |
type=ref,event=branch | |
type=ref,event=tag | |
type=sha,prefix=sha- | |
- name: Set Docker image metadata for web | |
uses: docker/metadata-action@v5 | |
id: meta-web | |
with: | |
images: ghcr.io/planb-network/blms-web | |
tags: | | |
type=schedule | |
type=ref,event=branch | |
type=ref,event=tag | |
type=sha,prefix=sha- | |
- name: Build and push Docker image for api | |
uses: docker/bake-action@v5 | |
with: | |
push: true | |
files: | | |
./docker-bake.hcl | |
${{ steps.meta-api.outputs.bake-file }} | |
targets: api | |
- name: Build and push Docker image for web | |
uses: docker/bake-action@v5 | |
with: | |
push: true | |
files: | | |
./docker-bake.hcl | |
${{ steps.meta-web.outputs.bake-file }} | |
targets: web | |
- name: Copy Docker files to server | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.SERVER_HOST }} | |
username: ${{ secrets.SERVER_USER }} | |
key: ${{ secrets.SERVER_SSH_KEY }} | |
source: 'docker/compose.yml,docker/cdn' | |
overwrite: true | |
strip_components: 1 | |
target: ${{ github.ref == 'refs/heads/mainnet' && 'mainnet' || 'testnet' }} | |
- name: Deploy to server | |
uses: appleboy/[email protected] | |
with: | |
host: ${{ secrets.SERVER_HOST }} | |
username: ${{ secrets.SERVER_USER }} | |
key: ${{ secrets.SERVER_SSH_KEY }} | |
script_stop: true | |
script: | | |
cd ${{ github.ref == 'refs/heads/mainnet' && 'mainnet' || 'testnet' }} | |
docker compose pull | |
docker compose stop || true | |
docker compose rm -f || true | |
docker compose up -d |