Workflow Fix 2 #3
This file contains hidden or 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: GS Editor Deployment | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v2 | |
| with: | |
| ref: build | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v2 | |
| with: | |
| node-version: '18' | |
| - name: Install Dependencies | |
| run: npm install | |
| - name: Build Project | |
| run: npm run build | |
| - name: Copy Build Files | |
| run: | | |
| cp -r dist/* . | |
| rm -rf dist | |
| - name: Commit and Push Changes | |
| env: | |
| TOKEN: ${{ secrets.GRAPHSCRIPT_EDITOR_TOKEN }} | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add . | |
| git diff --cached --quiet || git commit -m "Deploy GS Editor" | |
| git push https://x-access-token:${TOKEN}@github.com/GraphScript-Labs/graphscript-editor.git HEAD:build | |