diff options
author | Reinier van der Leer <pwuts@agpt.co> | 2024-02-21 02:00:33 +0100 |
---|---|---|
committer | Reinier van der Leer <pwuts@agpt.co> | 2024-02-21 02:00:33 +0100 |
commit | a88e8338311d845c212a91be559a7777a58cec5f (patch) | |
tree | 1a9bf5b903f89a4b2a520cd7ca4a93e16d8ecbd7 /.github | |
parent | chore(agent/llm): Update model alias `gpt-3.5-turbo` -> `gpt-3.5-turbo-0125` (diff) | |
download | Auto-GPT-a88e8338311d845c212a91be559a7777a58cec5f.tar.gz Auto-GPT-a88e8338311d845c212a91be559a7777a58cec5f.tar.bz2 Auto-GPT-a88e8338311d845c212a91be559a7777a58cec5f.zip |
ci: Revise Frontend CI
- Rename build-frontend.yml to frontend-ci.yml
- Add a `pull_request` trigger
- Disable committing and pushing to a `frontend_build_{hash}` branch
- (Re)enable auto-creating a pull request for the new frontend build
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/build-frontend.yml | 46 | ||||
-rw-r--r-- | .github/workflows/frontend-ci.yml | 59 |
2 files changed, 59 insertions, 46 deletions
diff --git a/.github/workflows/build-frontend.yml b/.github/workflows/build-frontend.yml deleted file mode 100644 index c6daf2e8c..000000000 --- a/.github/workflows/build-frontend.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: Build and Commit Frontend - -on: - push: - branches: - - master - - development - - 'ci-test*' # This will match any branch that starts with "ci-test" - paths: - - 'frontend/**' - -jobs: - build: - permissions: - contents: write - runs-on: ubuntu-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v4 - - name: Setup Flutter - uses: subosito/flutter-action@v2 - with: - flutter-version: '3.13.2' - - name: Build Flutter Web - run: | - cd frontend - flutter build web --base-href /app/ - - name: Set branch name - id: vars - run: echo "::set-output name=branch::frontend_build_${GITHUB_SHA}" - - name: Commit and Push - run: | - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - git add frontend/build/web - git commit -m "Update frontend build" -a - git checkout -b ${{ steps.vars.outputs.branch }} - echo "Commit hash: ${GITHUB_SHA}" - git push origin ${{ steps.vars.outputs.branch }} - # - name: Create Pull Request - # uses: peter-evans/create-pull-request@v3 - # with: - # title: "Update frontend build" - # body: "This PR updates the frontend build." - # branch: ${{ steps.vars.outputs.branch }} - # base: "master" diff --git a/.github/workflows/frontend-ci.yml b/.github/workflows/frontend-ci.yml new file mode 100644 index 000000000..d34f3bce9 --- /dev/null +++ b/.github/workflows/frontend-ci.yml @@ -0,0 +1,59 @@ +name: Frontend CI/CD + +on: + push: + branches: + - master + - development + - 'ci-test*' # This will match any branch that starts with "ci-test" + paths: + - 'frontend/**' + pull_request: + paths: + - 'frontend/**' + - '.github/workflows/build-frontend.yml' + +jobs: + build: + permissions: + contents: write + pull-requests: write + runs-on: ubuntu-latest + env: + BUILD_BRANCH: ${{ format('frontend-build/{0}', github.ref_name) }} + + steps: + - name: Checkout Repo + uses: actions/checkout@v4 + + - name: Setup Flutter + uses: subosito/flutter-action@v2 + with: + flutter-version: '3.13.2' + + - name: Build Flutter to Web + run: | + cd frontend + flutter build web --base-href /app/ + + # - name: Commit and Push to ${{ env.BUILD_BRANCH }} + # if: github.event_name == 'push' + # run: | + # git config --local user.email "action@github.com" + # git config --local user.name "GitHub Action" + # git add frontend/build/web + # git checkout -B ${{ env.BUILD_BRANCH }} + # git commit -m "Update frontend build to ${GITHUB_SHA:0:7}" -a + # git push -f origin ${{ env.BUILD_BRANCH }} + + - name: Create PR ${{ env.BUILD_BRANCH }} -> ${{ github.ref_name }} + if: github.event_name == 'push' + uses: peter-evans/create-pull-request@v6 + with: + add-paths: frontend/build/web + base: ${{ github.ref_name }} + branch: ${{ env.BUILD_BRANCH }} + delete-branch: true + title: "Update frontend build in `${{ github.ref_name }}`" + body: "This PR updates the frontend build based on commit ${{ github.sha }}." + commit-message: "Update frontend build based on commit ${{ github.sha }}" |