ci: trigger bee-js bee update (#58)

This commit is contained in:
Adam Uhlíř 2021-11-15 14:50:50 +01:00 committed by GitHub
parent ef353732ea
commit b2cce5cab0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 6 deletions

View File

@ -47,12 +47,12 @@ jobs:
- name: Override inputs from `workflow_dispatch`
run: |
if [[ '${{ github.event_name }}" == "workflow_dispatch"]]; then
echo "BEE_VERSION=${{ github.event.inputs.beeVersion }}" >> $GITHUB_ENV
echo "BUILD_IMAGE=${{ github.event.inputs.beeVersionAsCommitHash }}" >> $GITHUB_ENV
echo "COMMIT_VERSION_TAG=${{ github.event.inputs.commitVersionTag }}" >> $GITHUB_ENV
echo "STATE_COMMIT=${{ github.event.inputs.stateCommit }}" >> $GITHUB_ENV
fi
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
echo "BEE_VERSION=${{ github.event.inputs.beeVersion }}" >> $GITHUB_ENV
echo "BUILD_IMAGE=${{ github.event.inputs.beeVersionAsCommitHash }}" >> $GITHUB_ENV
echo "COMMIT_VERSION_TAG=${{ github.event.inputs.commitVersionTag }}" >> $GITHUB_ENV
echo "STATE_COMMIT=${{ github.event.inputs.stateCommit }}" >> $GITHUB_ENV
fi
- name: Auth to Github Package Docker Registry
if: ${{ github.event_name == 'repository_dispatch' || (github.event.inputs.buildImage == 'true' && success()) }}
@ -74,6 +74,16 @@ jobs:
npm run build:env -- $BUILD_PARAMS
- name: Publish if required
id: publish
if: ${{ github.event_name == 'repository_dispatch' || (github.event.inputs.buildImage == 'true' && success()) }}
run: |
npm run publish:env
- name: Trigger Bee-js PR creation
if: ${{ github.event_name == 'repository_dispatch' }}
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.REPO_GHA_PAT }}
repository: ethersphere/bee-js
event-type: update-bee
client-payload: '{"imageVersion": "${{ steps.publish.outputs.bee-version }}"}'

View File

@ -33,3 +33,9 @@ done
echo "Push Blockchain docker image: $BLOCKCHAIN_IMAGE_NAME"
docker push "$BLOCKCHAIN_IMAGE_NAME"
# This sets output parameter in Github Actions that
# is then used to trigger Bee-js PR creation
if [ $CI == 'true' ]; then
echo "::set-output name=bee-version::$BEE_VERSION"
fi