github.com/tada-team/tdproto@v1.51.57/.github/workflows/ts_deploy.yml (about) 1 --- 2 name: Generate and deploy typescript 3 4 on: [push] 5 6 env: 7 CLONE_DIR: clone_dir 8 TYPESCRIPT_FILE: src/index.ts 9 10 concurrency: 11 group: ${{ github.workflow }} 12 cancel-in-progress: false 13 14 jobs: 15 build: 16 runs-on: ubuntu-20.04 17 environment: typescript_deployment 18 steps: 19 - uses: actions/checkout@v2 20 - uses: actions/setup-go@v2 21 with: 22 go-version: '1.16' 23 - uses: actions/setup-node@v2 24 with: 25 node-version: '15' 26 - name: Clone typescript repo 27 uses: actions/checkout@v2 28 with: 29 repository: 'tada-team/tdproto-ts' 30 ssh-key: ${{ secrets.TYPESCRIPT_DEPLOY_KEY }} 31 ref: autogenerated 32 path: 'clone_dir' 33 - name: Generate typescript 34 run: | 35 go run ./codegen/typescript/ > "$CLONE_DIR"/"$TYPESCRIPT_FILE" 36 - name: Run linter 37 run: | 38 cd "$CLONE_DIR" 39 npm i 40 npm run fix 41 npm run check-types 42 npm run build 43 - name: Commit and upload typescript 44 if: github.ref == 'refs/heads/master' 45 run: | 46 cd "$CLONE_DIR" 47 git add --all 48 git config --global user.email "action@github.com" 49 git config --global user.name "Github Action" 50 git commit -m "Generate typescript on $(date)" --allow-empty 51 git push