Auto build APP image #29665
This file contains hidden or 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 APP image | |
| on: | |
| issue_comment: | |
| types: | |
| - created | |
| jobs: | |
| resolve-issue-var: | |
| if: startswith(github.event.comment.body, '/imagebuild_apps') | |
| runs-on: ubuntu-latest | |
| outputs: | |
| app: ${{ steps.set-appversion.outputs.app }} | |
| version: ${{ steps.set-appversion.outputs.version }} | |
| steps: | |
| - name: Write vars | |
| id: set-appversion | |
| run: | | |
| commentbody="${{github.event.comment.body}}" | |
| app=`echo "$commentbody"| awk '{print $2}'` | |
| version=`echo "$commentbody"| awk '{print $3}'` | |
| echo "app=$app" >> $GITHUB_OUTPUT | |
| echo "version=$version" >> $GITHUB_OUTPUT | |
| build_apps: | |
| name: Auto build app image | |
| needs: | |
| - resolve-issue-var | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| arch: [ amd64,arm64 ] | |
| permissions: | |
| issues: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| - name: Download buildah and sealos | |
| run: .github/scripts/download.sh | |
| - name: Build Image | |
| env: | |
| registry: ${{ vars.D_REGISTRY_NAME }} | |
| username: ${{ vars.D_REGISTRY_REPOSITORY }} | |
| repo: ${{ vars.D_REGISTRY_REPOSITORY }} | |
| password: ${{ secrets.D_REGISTRY_TOKEN }} | |
| app: ${{ needs.resolve-issue-var.outputs.app }} | |
| version: ${{ needs.resolve-issue-var.outputs.version }} | |
| arch: ${{ matrix.arch }} | |
| run: .github/scripts/apps.sh | |
| build_manifest: | |
| needs: | |
| - resolve-issue-var | |
| - build_apps | |
| name: Auto manifest app image | |
| runs-on: ubuntu-latest | |
| permissions: | |
| issues: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| - name: Download buildah and sealos | |
| run: .github/scripts/download.sh | |
| - name: Manifest Image | |
| env: | |
| registry: ${{ vars.D_REGISTRY_NAME }} | |
| username: ${{ vars.D_REGISTRY_REPOSITORY }} | |
| repo: ${{ vars.D_REGISTRY_REPOSITORY }} | |
| password: ${{ secrets.D_REGISTRY_TOKEN }} | |
| app: ${{ needs.resolve-issue-var.outputs.app }} | |
| version: ${{ needs.resolve-issue-var.outputs.version }} | |
| run: .github/scripts/manifest-other.sh | |
| add-tips: | |
| if: contains(github.event.comment.body, 'imagebuild') | |
| needs: | |
| - build_manifest | |
| - resolve-issue-var | |
| name: Auto add tips | |
| runs-on: ubuntu-latest | |
| permissions: | |
| issues: write | |
| steps: | |
| - name: Success Commit | |
| uses: peter-evans/create-or-update-comment@v1 | |
| with: | |
| issue-number: ${{ github.event.issue.number }} | |
| body: | | |
| ``` | |
| image docker.io/${{ vars.D_REGISTRY_REPOSITORY }}/${{ needs.resolve-issue-var.outputs.app }}:${{ needs.resolve-issue-var.outputs.version }} build successfully! | |
| ``` | |
| See: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }} |