Skip to content

Commit

Permalink
Add/update Plasmic workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
plasmicops committed Sep 28, 2024
0 parents commit 2cb7ae5
Showing 1 changed file with 79 additions and 0 deletions.
79 changes: 79 additions & 0 deletions .github/workflows/plasmic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
# Plasmic workflow v4
name: Sync, build and deploy Plasmic app

permissions:
contents: write
pull-requests: write

on:
repository_dispatch:
types: [plasmic]

jobs:
job:
name: Sync, build and deploy
runs-on: ubuntu-latest
steps:
- id: checkout
name: Checking out repository...
uses: actions/checkout@v2
with:
persist-credentials: false
fetch-depth: 0
- id: node
name: Setting up node v18...
uses: actions/setup-node@v3
with:
node-version: "18"
- id: cache
name: Recovering cache...
uses: actions/cache@v2
with:
key: lock-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}
path: ${{ github.event.client_payload.data.directory }}/node_modules
- id: init
name: Initializing Plasmic app...
uses: plasmicapp/plasmic-action@master
with:
run: init
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.event.client_payload.data.branch }}
directory: ${{ github.event.client_payload.data.directory }}
project_id: ${{ github.event.client_payload.data.projectId }}
project_api_token: ${{ github.event.client_payload.data.projectApiToken }}
platform: ${{ github.event.client_payload.data.platform }}
language: ${{ github.event.client_payload.data.language }}
scheme: ${{ github.event.client_payload.data.scheme }}
title: ${{ github.event.client_payload.data.title }}
description: ${{ github.event.client_payload.data.description }}
- id: sync
name: Syncing Plasmic project...
if: ${{ github.event.client_payload.data.scheme == 'codegen' && steps.init.outputs.synced != 'true' }}
uses: plasmicapp/plasmic-action@master
with:
run: sync
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.event.client_payload.data.branch }}
directory: ${{ github.event.client_payload.data.directory }}
project_id: ${{ github.event.client_payload.data.projectId }}
project_api_token: ${{ github.event.client_payload.data.projectApiToken }}
sync_action: ${{ github.event.client_payload.data.syncAction }}
title: ${{ github.event.client_payload.data.title }}
description: ${{ github.event.client_payload.data.description }}
- id: build
name: Building Plasmic app...
if: ${{ github.event.client_payload.data.publish }}
uses: plasmicapp/plasmic-action@master
with:
run: build
branch: ${{ github.event.client_payload.data.branch }}
directory: ${{ github.event.client_payload.data.directory }}
platform: ${{ github.event.client_payload.data.platform }}
- id: pr
name: Creating pull request...
uses: repo-sync/pull-request@v2
if: ${{ steps.sync.outputs.new_branch }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
source_branch: ${{ steps.sync.outputs.new_branch }}
destination_branch: ${{ github.event.client_payload.data.branch }}

0 comments on commit 2cb7ae5

Please sign in to comment.