auto build sealer ClusterImage using github action #81
This file contains 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: Auto build image | |
on: | |
issue_comment: | |
types: | |
- created | |
jobs: | |
issue_comment: | |
name: Auto build image | |
if: startswith(github.event.comment.body, '/imagebuild') | |
runs-on: ubuntu-latest | |
permissions: | |
issues: write | |
steps: | |
- name: Auto build image | |
id: autobuild | |
run: | | |
commentbody="${{github.event.comment.body}}" | |
commentbody=$(echo $commentbody | sed "s/\/imagebuild//g") | |
sudo git clone https://github.com/sealerio/basefs.git && cd basefs | |
sudo touch autobuild.log && sudo chmod 666 autobuild.log && sudo bash auto-build.sh --username="${{secrets.REGISTRY_USERNAME}}" --password="${{secrets.REGISTRY_PASSWORD}}" $commentbody > autobuild.log && cat autobuild.log | |
echo "::set-output name=info::$(grep 'cri:' autobuild.log))" | |
- name: Success Commit | |
uses: peter-evans/create-or-update-comment@v1 | |
with: | |
issue-number: ${{ github.event.issue.number }} | |
body: | | |
${{ steps.autobuild.outputs.info }} |