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: 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/platform | |
# 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: | |
# GH_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://github.com/gamba-labs/test.git | |
# git push --force origin master |