Use sparkfabrik action for Android build #6
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: Build and Deploy | |
| on: | |
| push: | |
| branches: [ main, elizaos-challenge ] | |
| workflow_dispatch: | |
| env: | |
| DOCKER_IMAGE: ${{ secrets.DOCKER_USERNAME }}/miku | |
| NOSANA_API_KEY: ${{ secrets.NOSANA_API_KEY }} | |
| jobs: | |
| build-android: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Build Android APK | |
| uses: sparkfabrik/android-build-action@v1.5.0 | |
| with: | |
| project-path: android | |
| output-path: app-release.apk | |
| - name: Upload APK Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: android-apk | |
| path: app-release.apk | |
| - name: Create Release | |
| if: github.ref == 'refs/heads/main' | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: v${{ github.run_number }} | |
| name: Release v${{ github.run_number }} | |
| files: app-release.apk | |
| generate_release_notes: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| build-and-deploy-agent: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| push: true | |
| tags: | | |
| ${{ env.DOCKER_IMAGE }}:latest | |
| ${{ env.DOCKER_IMAGE }}:${{ github.sha }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Install Nosana CLI | |
| run: npm install -g @nosana/cli | |
| - name: Deploy to Nosana | |
| run: | | |
| nosana job post \ | |
| --file ./nos_job_def/nosana_eliza_job_definition.json \ | |
| --market nvidia-3090 \ | |
| --timeout 300 \ | |
| --api ${{ env.NOSANA_API_KEY }} |