Skip to content

Commit

Permalink
init commit
Browse files Browse the repository at this point in the history
  • Loading branch information
cuisongliu committed Nov 15, 2023
1 parent 6c75a75 commit 040f407
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 2 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/autobuild-apps-cirun.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build wasi image by cirun
on:
issue_comment:
types:
- created
jobs:
resolve-issue-var:
if: startswith(github.event.comment.body, '/imagebuild_cirun_apps') && github.event.sender.login=='cuisongliu'
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-wasi:
name: Auto build app image
needs:
- resolve-issue-var
runs-on: cirun-gcp-amd64--${{ github.run_id }}
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 }}
run: .github/scripts/apps.sh
add-tips:
if: contains(github.event.comment.body, 'imagebuild')
needs:
- resolve-issue-var
- build-wasi
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 ${{ vars.D_REGISTRY_NAME }}/${{ 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 }}
4 changes: 2 additions & 2 deletions .github/workflows/autobuild-apps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
run: .github/scripts/download.sh
- name: Build Image
env:
registry: docker.io
registry: ${{ vars.D_REGISTRY_NAME }}
username: ${{ vars.D_REGISTRY_REPOSITORY }}
repo: ${{ vars.D_REGISTRY_REPOSITORY }}
password: ${{ secrets.D_REGISTRY_TOKEN }}
Expand All @@ -56,7 +56,7 @@ jobs:
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!
image ${{ vars.D_REGISTRY_NAME }}/${{ 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 }}

0 comments on commit 040f407

Please sign in to comment.