Update cd.yml #2
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: Create PR with Build | |
on: | |
push: | |
branches: | |
- develop | |
jobs: | |
build-and-create-pr: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: npm install | |
- name: Build | |
run: npm run build | |
- name: Create PR Branch | |
run: | | |
git config --global user.name "github-actions-bot" | |
git config --global user.email "support+actions@github.com" | |
# Create a new branch with timestamp to ensure uniqueness | |
timestamp=$(date +%s) | |
branch_name="build-update-${timestamp}" | |
git checkout -b $branch_name | |
# Add and commit build files | |
git add build/ | |
git commit -m "Update build files" | |
git push origin $branch_name | |
- name: Create Pull Request | |
uses: repo-sync/pull-request@v2 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
destination_branch: "gh-pages" | |
pr_title: "Update build files" | |
pr_body: "Automated PR to update build files" | |
pr_label: "automated pr" |