Skip to content

Commit

Permalink
feat(devtools): build devtools artifacts (#14)
Browse files Browse the repository at this point in the history
* chore: Add build artifact to artifact branch

* Fix: identation error on gh action

* Fix path

* Fix: Attempt to fix permission issue

* Fix: Syntax error

* Test with new branch

* Add permissions

* Add write permission to content

* Add git pull to get the latest changes

* pull from origin main

* Add git fetch origin

* Add force push

* remove redundance with

* use force instead
  • Loading branch information
quekyj authored Feb 9, 2024
1 parent 33b2216 commit 635abf2
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/general.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ jobs:

build-devtool:
name: Build Devtools
permissions:
contents: write
pull-requests: write
timeout-minutes: 30
runs-on: ubuntu-22.04
steps:
Expand All @@ -112,4 +115,26 @@ jobs:
- name: Build Static Web
run: tool/gh_actions/devtool/build_web.sh

# 1. checkout to branch artifacts
# 2. Do not ignore build/ folder (just for artifacts branch)
# 3. Commit everythings including the build/ folder
# 4. Push the new branch artifacts
- name: Create artifact branch and commit
run: |
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git fetch origin
git checkout -b artifacts
git pull origin main
sed -i '/build\//d' .gitignore # Remove the line that ignores the build directory
git add .
git commit -m "Add build artifacts and modify .gitignore"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: artifacts
force: true


0 comments on commit 635abf2

Please sign in to comment.