Skip to content

Create UI package

Create UI package #628

Workflow file for this run

name: Release
on:
push:
branches: [main]
tags:
- "v*"
pull_request:
jobs:
continuous-integration:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.GH_TOKEN }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"
registry-url: "https://npm.pkg.github.com/"
scope: "@frameless"
- run: yarn install --frozen-lockfile
- name: Make the root envfile
uses: SpicyPizza/create-envfile@v1.3
with:
envkey_DEBUG: false
envkey_HOST: ${{ secrets.HOST }}
envkey_PORT: ${{ secrets.PORT }}
envkey_DATABASE_HOST: ${{ secrets.DATABASE_HOST }}
envkey_APP_KEYS: ${{ secrets.APP_KEYS }}
envkey_API_TOKEN_SALT: ${{ secrets.API_TOKEN_SALT }}
envkey_ADMIN_JWT_SECRET: ${{ secrets.ADMIN_JWT_SECRET }}
envkey_JWT_SECRET: ${{ secrets.JWT_SECRET }}
envkey_PREVIEW_SECRET_TOKEN: ${{ secrets.PREVIEW_SECRET_TOKEN }}
envkey_TRANSFER_TOKEN_SALT: ${{ secrets.TRANSFER_TOKEN_SALT }}
envkey_DATABASE_CLIENT: ${{ secrets.DATABASE_CLIENT }}
envkey_DATABASE_PORT: ${{ secrets.DATABASE_PORT }}
envkey_STRAPI_PRIVATE_URL: ${{ secrets.STRAPI_PRIVATE_URL }}
envkey_DATABASE_NAME: ${{ secrets.DATABASE_NAME }}
envkey_DATABASE_USERNAME: ${{ secrets.DATABASE_USERNAME }}
envkey_DATABASE_PASSWORD: ${{ secrets.DATABASE_PASSWORD }}
envkey_DATABASE_SSL: ${{ secrets.DATABASE_SSL }}
envkey_NODE_ENV: ${{ secrets.NODE_ENV }}
envkey_FRONTEND_PUBLIC_URL: ${{ secrets.FRONTEND_PUBLIC_URL }}
envkey_PGADMIN_DEFAULT_EMAIL: ${{ secrets.PGADMIN_DEFAULT_EMAIL }}
envkey_PGADMIN_DEFAULT_PASSWORD: ${{ secrets.PGADMIN_DEFAULT_PASSWORD }}
envkey_STRAPI_PUBLIC_URL: ${{ secrets.STRAPI_PUBLIC_URL }}
file_name: .prod.env
fail_on_empty: false
- name: Build
run: npm run --workspace packages build --if-present
- name: Lint
env:
NODE_OPTIONS: "--max_old_space_size=4096"
run: npm run lint
- name: Release
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/beta'
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
run: |
npm config set "//npm.pkg.github.com/:_authToken=${GH_TOKEN}"
npm config set workspaces-update false
npm run release
npm config delete "//npm.pkg.github.com/:_authToken"
continuous-deployment:
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.GH_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
ghcr.io/${{ github.repository }}
tags: |
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=raw,value={{sha}},enable=${{ github.ref_type != 'tag' }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
file: Dockerfile.prod
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}