Skip to content

Workflow file for this run

name: Sync Platform to Separate Repo
on:
push:
paths:
- 'apps/platform/**'
- 'packages/**'
workflow_dispatch:
jobs:
sync-example:
runs-on: ubuntu-latest
steps:
- name: Checkout Monorepo
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18.12'
- name: Install pnpm
run: npm install -g pnpm
- name: Install Dependencies
run: pnpm install
- name: Copy Platform to Temp Directory
run: |
mkdir -p temp/platform
cp -r apps/platform/* temp/platform/
- name: Update Dependencies
run: |
cd temp/example
for package in $(jq -r '.dependencies | keys[]' package.json); do
version=$(pnpm info $package version)
jq --arg pkg $package --arg ver $version '.dependencies[$pkg] = $ver' package.json > tmp.json && mv tmp.json package.json
done
- name: Push to Separate Repo
env:
TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd temp/platform
git init
git config user.name "github-actions"
git config user.email "github-actions@github.com"
git add .
git commit -m "Update platform"
git remote add origin https://${{ secrets.GITHUB_TOKEN }}@github.com/gamba-labs/test.git
git push --force origin master