chore: setup github actions for auto build #1
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 | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Setup Rust | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: stable | |
| target: wasm32-unknown-unknown | |
| override: true | |
| - name: Install Trunk | |
| run: cargo install trunk | |
| - name: Build Frontend | |
| working-directory: ./codedroid_frontend | |
| run: trunk build --release | |
| - name: Deploy to Netlify | |
| uses: nwtgck/actions-netlify@v2.0 | |
| with: | |
| publish-dir: './codedroid_frontend/dist' | |
| production-deploy: true | |
| github-token: ${{ secrets.GITHUB_TOKEN }} | |
| deploy-message: "Deploy from GitHub Actions" | |
| env: | |
| NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} | |
| NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }} |