Build Frontend #29
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 Frontend | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'frontend/**' | |
| workflow_dispatch: | |
| inputs: | |
| docker_image_tag: | |
| description: 'Docker image tag (e.g., nightly)' | |
| required: false | |
| default: 'nightly' | |
| docker_image_tag_version: | |
| description: 'Docker image version tag (e.g., 3.7.x)' | |
| required: false | |
| default: '3.7.x' | |
| docker_image_tag_env: | |
| description: 'Docker image environment tag (e.g., dev3)' | |
| required: false | |
| default: 'dev3' | |
| env: | |
| IMAGE: openmrs/openmrs-reference-application-3-frontend | |
| DOCKER_IMAGE_TAG: ${{ github.event.inputs.docker_image_tag || 'nightly' }} | |
| DOCKER_IMAGE_TAG_VERSION: ${{ github.event.inputs.docker_image_tag_version || '3.7.x' }} | |
| DOCKER_IMAGE_TAG_ENV: ${{ github.event.inputs.docker_image_tag_env || 'dev3' }} | |
| DOCKER_IMAGE_PLATFORMS: linux/amd64,linux/arm64 | |
| jobs: | |
| build-and-publish: | |
| name: Build and Publish the Frontend Image | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Log in to Docker Hub | |
| uses: docker/login-action@v4 | |
| with: | |
| username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
| password: ${{ secrets.DOCKER_HUB_TOKEN }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: ./frontend | |
| push: true | |
| platforms: ${{ env.DOCKER_IMAGE_PLATFORMS }} | |
| build-args: | | |
| CACHE_BUST=${{ github.run_id }} | |
| tags: | | |
| ${{ env.IMAGE }}:${{ env.DOCKER_IMAGE_TAG }} | |
| ${{ env.IMAGE }}:${{ env.DOCKER_IMAGE_TAG_VERSION }} | |
| ${{ env.IMAGE }}:${{ env.DOCKER_IMAGE_TAG_ENV }} |