Update installation instructions in README #21
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 with Bun | |
| on: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| branches: [master] | |
| env: | |
| REGISTRY: ghcr.io | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read # Required for actions/checkout | |
| packages: write # Required to publish docker image | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Install Bun | |
| run: | | |
| curl -fsSL https://bun.sh/install | bash | |
| echo "$HOME/.bun/bin" >> $GITHUB_PATH | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Build | |
| run: bun run build | |
| - name: Upload client artifact for deployment job | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: client-app | |
| path: packages/client/dist | |
| - name: Upload server artifact for deployment job | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: server-app | |
| path: packages/server/dist | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to GitHub container registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ github.token }} | |
| - name: Lowercase the repo name and username as container tags must be lowercase | |
| run: echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV} | |
| - name: Build and push container image to registry | |
| id: push | |
| uses: docker/build-push-action@v5 | |
| with: | |
| push: ${{ github.event_name == 'push' }} # always build the container (incl. Pull Requests), but only push to the registry on code push | |
| tags: ${{ env.REGISTRY }}/${{ env.REPO }}:${{ github.sha }} | |
| file: ./Dockerfile | |
| deploy-container: | |
| if: github.event_name == 'push' # Only deploy on push events | |
| runs-on: ubuntu-latest | |
| needs: build | |
| environment: | |
| name: 'Production' | |
| url: ${{ steps.deploy-to-webapp-container.outputs.webapp-url }} | |
| permissions: | |
| id-token: write #This is required for requesting the JWT | |
| contents: read #This is required for actions/checkout | |
| steps: | |
| - name: Lowercase the repo name and username as container tags must be lowercase | |
| run: echo "REPO=${GITHUB_REPOSITORY,,}" >>${GITHUB_ENV} | |
| - name: Deploy to Azure Web App | |
| id: deploy-to-webapp-container | |
| uses: azure/webapps-deploy@v2 | |
| with: | |
| app-name: 'botio' | |
| slot-name: 'Production' | |
| publish-profile: ${{ secrets.AZUREAPPSERVICE_CONTAINER_PUBLISH_PROFILE }} | |
| images: '${{ env.REGISTRY }}/${{ env.REPO }}:${{ github.sha }}' |