checkout main before build #11
This file contains 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: Build and Compile code modules | |
on: | |
push: | |
branches: | |
- main | |
release: | |
types: [released] | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
timeout-minutes: 5 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
ref: main | |
- name: Install dependencies | |
run: npm install | |
- name: Install ncc | |
run: npm install -g @vercel/ncc | |
- name: Build | |
run: npm run build | |
- name: Create a new branch | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git checkout -b build-output-${{ github.run_id }} | |
git add . | |
git commit -m "Build output for release ${{ github.sha }}" | |
- name: Push changes to new branch | |
run: git push origin build-output-${{ github.run_id }} | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
branch: build-output-${{ github.run_id }} | |
base: main | |
title: "Build output for release ${{ github.sha }}" | |
body: "This PR contains the compiled code modules for release ${{ github.sha }}." | |
labels: build |