Build and push Docker container #20
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 push Docker container" | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| branch: | |
| description: Choose branch or tag, defaults to main | |
| type: string | |
| required: true | |
| default: main | |
| emsdk_version: | |
| description: Emscripten SDK version, defaults to 4.0.20 | |
| type: string | |
| required: false | |
| default: "4.0.20" | |
| docker_tag: | |
| description: Docker tag to use, defaults to latest | |
| type: string | |
| required: false | |
| default: "latest" | |
| jobs: | |
| build: | |
| runs-on: "ubuntu-latest" | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ inputs.branch }} | |
| submodules: 'true' | |
| - name: Install Linux deps | |
| run: | | |
| sudo apt update | |
| sudo apt -y install wget unzip | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| - name: Install Node Dependencies | |
| run: | | |
| npm ci | |
| - name: Setup Emscripten SDK | |
| run: | | |
| wget https://github.com/emscripten-core/emsdk/archive/main.zip | |
| unzip main.zip | |
| cd emsdk-main | |
| ./emsdk install ${{ inputs.emsdk_version }} | |
| ./emsdk activate ${{ inputs.emsdk_version }} | |
| source ./emsdk_env.sh | |
| echo "EMSDK=$EMSDK" >> $GITHUB_ENV | |
| echo "EM_CONFIG=$EM_CONFIG" >> $GITHUB_ENV | |
| echo "$EMSDK:$EMSDK/upstream/emscripten" >> $GITHUB_PATH | |
| - name: Build WASM modules | |
| run: | | |
| source "$EMSDK/emsdk_env.sh" | |
| npm run build:wasm | |
| - name: Build main worker bundle | |
| run: | | |
| npm run build:bundle | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: ./ | |
| platforms: linux/amd64,linux/arm64 | |
| pull: true | |
| push: true | |
| tags: | | |
| jitsi/opus-transcriber-proxy:${{ inputs.docker_tag }} | |
| jitsi/opus-transcriber-proxy:${{ github.sha }} |