examples/bun (staging) #55
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: examples/bun (staging) | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: [ bun ] | |
| paths: | |
| - '.github/workflows/example-bun-staging.yaml' | |
| - 'bun/**' | |
| - '!bun/README.md' | |
| pull_request: | |
| types: [ opened, synchronize, reopened ] | |
| branches: [ main ] | |
| paths: | |
| - '.github/workflows/example-bun-staging.yaml' | |
| - 'bun/**' | |
| - '!bun/README.md' | |
| schedule: | |
| - cron: '0 15 * * 1-5' | |
| # Automatically cancel in-progress actions on the same branch | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.event_name == 'pull_request_target' && github.head_ref || github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| UKC_METRO: "https://api.${{ vars.UKC_METRO_STAGING }}.unikraft.cloud/v1" | |
| UKC_TOKEN: ${{ secrets.UKC_TOKEN }} | |
| KRAFTKIT_NO_CHECK_UPDATES: true | |
| KRAFTKIT_LOG_LEVEL: debug | |
| jobs: | |
| integration: | |
| timeout-minutes: 60 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Test | |
| id: test | |
| uses: unikraft/kraftkit@staging | |
| with: | |
| run: | | |
| set -xe; | |
| cd bun; | |
| kraft cloud deploy \ | |
| --no-start \ | |
| --name bun-${GITHUB_RUN_ID} \ | |
| --runtime index.unikraft.io/official-staging/base-compat:latest \ | |
| --subdomain bun-${GITHUB_RUN_ID} \ | |
| -p 443:3000 \ | |
| -M 512 \ | |
| .; | |
| # wait for the instance to start | |
| kraft cloud vm start -w 5s bun-${GITHUB_RUN_ID}; | |
| sleep 5; | |
| curl -Lv --fail-with-body --max-time 10 https://bun-${GITHUB_RUN_ID}.${{ vars.UKC_METRO_STAGING }}.unikraft.app | |
| - name: Cleanup | |
| uses: unikraft/kraftkit@staging | |
| if: always() | |
| with: | |
| run: | | |
| set -xe; | |
| kraft cloud vm stop bun-${GITHUB_RUN_ID} || true; | |
| kraft cloud vm logs bun-${GITHUB_RUN_ID} || true; | |
| kraft cloud vm rm bun-${GITHUB_RUN_ID} || true; | |
| kraft cloud img rm index.unikraft.io/test/bun-${GITHUB_RUN_ID} || true; |