diff --git a/.github/workflows/build-dist.yml b/.github/workflows/build-dist.yml new file mode 100644 index 0000000..f577108 --- /dev/null +++ b/.github/workflows/build-dist.yml @@ -0,0 +1,33 @@ +name: Build dist + +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Install dependencies + run: npm install + + - name: Build + run: npm run build + + - name: Push dist to main-dist branch + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git checkout -B main-dist + git add -f dist/ + git commit -m "chore: build dist from main [skip ci]" + git push origin main-dist --force