Skip to content

feat: add finish handler for ops (#2633) #1740

feat: add finish handler for ops (#2633)

feat: add finish handler for ops (#2633) #1740

name: upload-frontend-assets
on:
workflow_dispatch:
push:
branches:
- master
jobs:
build-assets:
name: Build frontend assets
runs-on: ubuntu-8core
timeout-minutes: 10
environment:
name: release
permissions:
contents: 'write'
id-token: 'write'
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.WANDBMACHINE_GITHUB_TOKEN }}
fetch-depth: 0
- uses: actions/setup-node@v1
with:
node-version: '20.x'
- id: 'build'
run: |
./weave_query/weave_query/frontend/build.sh
if [[ -z "$(git status weave_query/weave_query/frontend/sha1.txt --porcelain)" ]]
then
echo "Frontend assets has not changed, skipping publishing"
echo "UPLOAD_ASSETS=false" >> "$GITHUB_OUTPUT"
else
echo "Frontend assets changed, pushing updates"
git diff
echo "UPLOAD_ASSETS=true" >> "$GITHUB_OUTPUT"
fi
- id: 'auth'
name: 'Authenticate to Google Cloud'
uses: 'google-github-actions/auth@v1'
if: ${{ steps.build.outputs.UPLOAD_ASSETS == 'true' }}
with:
workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}
# the service account secret format is wrong, hard coding it until it is fixed in core
#service_account: ${{ secrets.WORKLOAD_IDENTITY_SERVICE_ACCOUNT }}
service_account: [email protected]
- id: 'upload-and-push'
if: ${{ steps.build.outputs.UPLOAD_ASSETS == 'true' }}
run: |
./weave_query/weave_query/frontend/bundle.sh
git config --global user.name 'Weave Build Bot'
git config --global user.email [email protected]
git commit -a -m 'chore(bot): update frontend bundle sha [no ci]'
git push