name: Build on: push: branches: [ master ] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 with: fetch-depth: 0 - name: Setup Node.js v15.x uses: actions/setup-node@v2 with: node-version: 15.x - name: Install NPM dependencies run: npm ci - name: Build GooseMod run: npm run build - name: Build Dev Changelog run: bash building/generateDevChangelog.sh - name: Dev GitHub Release uses: ncipollo/release-action@v1 with: tag: "dev" allowUpdates: true prerelease: true artifacts: "dist/index.js" name: "GooseMod Dev" bodyFile: "dist/devChangelog.md" token: ${{ secrets.GITHUB_TOKEN }} - name: Dev Dist Branch run: | git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" git config --local user.name "github-actions[bot]" rm -rf ../dist cp -rf dist .. git checkout dist-dev -- rm -rf * cp -rf ../dist/* . git add --all git commit -m "[CI Chore] Update dist-dev" git push origin dist-dev - name: Prod Dist Branch if: ${{ contains(github.event.head_commit.message, '[Release] ') }} run: | git checkout dist-prod -- rm -rf * cp -rf ../dist/* . sed -i 's/dist-dev/dist-prod/g' index.js git add --all git commit -m "[CI Chore] Update dist-prod" git push origin dist-prod