Skip to content

feat(gdpr): add gdpr check on event booking #4314

feat(gdpr): add gdpr check on event booking

feat(gdpr): add gdpr check on event booking #4314

Workflow file for this run

name: CI/CD
on:
push:
branches:
- mainnet
- testnet
- dev
pull_request:
env:
TURBO_TELEMETRY_DISABLED: 1
jobs:
build_and_test:
if: github.event_name != 'pull_request' || github.event.pull_request.head.ref != 'weblate-tr'
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 update
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
env:
VITE_GITHUB_SHA: ${{ github.sha }}
- name: Lint Code
run: pnpm lint
# // TODO Add pnpm check-boundaries ?
- name: Run tests
run: pnpm test
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@v6
with:
push: true
files: |
./docker-bake.hcl
cwd://${{ steps.meta-api.outputs.bake-file }}
targets: api
- name: Build and push Docker image for web
uses: docker/bake-action@v6
with:
push: true
files: |
./docker-bake.hcl
cwd://${{ steps.meta-web.outputs.bake-file }}
targets: web
env:
GITHUB_SHA: ${{ github.sha }}
- name: Prepare compose file with environment variables
run: |
if [ "${GITHUB_REF}" = "refs/heads/mainnet" ]; then
sed -i 's/planbenvtoreplace/mainnet/g' docker/compose.yml
else
sed -i 's/planbenvtoreplace/testnet/g' docker/compose.yml
fi
env:
GITHUB_REF: ${{ github.ref }}
- name: Copy Docker files to server
uses: appleboy/scp-action@v0.1.7
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/ssh-action@v1.2.0
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