Skip to content

Commit

Permalink
adjust ci
Browse files Browse the repository at this point in the history
  • Loading branch information
riccardoperra committed Nov 10, 2024
1 parent 7fc67b8 commit a0f9ac2
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 7 deletions.
40 changes: 34 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@ on:
options:
- main
- appwrite
env:
RAILWAY_ENVIRONMENT: ${{vars.RAILWAY_ENVIRONMENT}}

jobs:
build:
environment: ${{((inputs.env == 'main' || github.ref_name == 'main') && 'production') || ((inputs.env == 'appwrite' || github.ref_name == 'appwrite') && 'appwrite' || 0)}}
runs-on: ubuntu-latest
outputs:
appArtifactName: app-build-${{github.sha}}
steps:
- name: Checkout PR
uses: actions/checkout@v4
Expand All @@ -35,11 +39,35 @@ jobs:
- name: Build app
run: |
pnpm --filter @pipelineui/app build
cp packages/app/nixpacks.toml packages/app/.output
- name: Deploy to Railway
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
path: |
packages/app/.output/**
retention-days: 1

deploy:
environment: ${{((inputs.env == 'main' || github.ref_name == 'main') && 'production') || ((inputs.env == 'appwrite' || github.ref_name == 'appwrite') && 'appwrite' || 0)}}
runs-on: ubuntu-latest
steps:
- name: Checkout PR
uses: actions/checkout@v4

- name: 📥 Setup
uses: ./.github/actions/setup-job

- name: 📥 Monorepo install
uses: ./.github/actions/pnpm-install

- name: Download app build artifact
uses: actions/download-artifact@v4
with:
name: app-build-${{github.sha}}
path: artifacts/app

- name: Deploy app to Railway
run: |
cd packages/app
cp nixpacks.toml .output
cp .output/server/package.json .output
cd .output
RAILWAY_TOKEN=${{ secrets.RAILWAY_DEPLOY_TOKEN }} pnpm railway up -s pipelineui-server -e ${{vars.RAILWAY_ENVIRONMENT}}
cd artifacts/app
RAILWAY_TOKEN=${{ secrets.RAILWAY_DEPLOY_TOKEN }} pnpm railway up -s pipelineui-server -e ${{env.RAILWAY_ENVIRONMENT}}
2 changes: 1 addition & 1 deletion packages/app/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import './app.css';
import './global-codeui.css';
import {I18nProvider} from './locales/i18n';

const {messages: enMessages} = await import('./locales/en.po');
import {messages as enMessages} from './locales/en.po';

export default function App() {
const i18n = setupI18n();
Expand Down

0 comments on commit a0f9ac2

Please sign in to comment.