Create and publish client docker image #84
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: Create and publish client docker image | |
| on: | |
| workflow_dispatch: | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: northeastern-electric-racing/argos-client | |
| jobs: | |
| build-and-push: | |
| runs-on: ubuntu-24.04 | |
| permissions: | |
| contents: read | |
| packages: write | |
| defaults: | |
| run: | |
| working-directory: ./angular-client | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 20.17.0 | |
| - name: Install deps | |
| run: npm ci | |
| - name: Build production bundle | |
| run: npm run build:production | |
| # Stage dist where Dockerfile.prebuilt expects it; /dist is in .dockerignore, | |
| # so the docker context can't pull from dist/angular-client/browser directly. | |
| - name: Stage dist into docker context | |
| run: cp -r dist/angular-client/browser browser | |
| - uses: docker/setup-qemu-action@v3 | |
| with: | |
| platforms: arm64 | |
| - uses: docker/setup-buildx-action@v4.0.0 | |
| - uses: docker/login-action@v4.0.0 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| # Multi-arch in one buildx push — apk add gettext is the only RUN, fine under QEMU. | |
| # All real CPU work (ng build) ran natively above; arch-sensitive part is just the nginx base layer. | |
| - uses: docker/build-push-action@v7.0.0 | |
| with: | |
| context: ./angular-client | |
| file: ./angular-client/Dockerfile.prebuilt | |
| push: true | |
| platforms: linux/amd64,linux/arm64 | |
| tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }} | |
| provenance: false |