Merge pull request #98 from DiamondLightSource/fix-incorrect-loader-a… #176
Workflow file for this run
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: Tomohub | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| build_and_deploy: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - app: frontend | |
| - app: backend | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| # Checkout the repository code | |
| - name: Checkout Code | |
| uses: actions/checkout@v4.2.2 | |
| # Generate the image names dynamically | |
| - name: Generate Image Names | |
| run: echo IMAGE=ghcr.io/$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]' | tr '[_]' '[\-]')-${{ matrix.app }} >> $GITHUB_ENV | |
| # Log in to GitHub Container Registry | |
| - name: Log in to GitHub Docker Registry | |
| if: github.event_name != 'pull_request' | |
| uses: docker/login-action@v3.3.0 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract Version from Tag | |
| id: tags | |
| run: echo version=$(echo "${{ github.ref_name }}" | cut -c 2-) >> $GITHUB_OUTPUT | |
| - name: Docker Metadata | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.IMAGE }} | |
| tags: | | |
| type=raw,value=${{ steps.tags.outputs.version }} | |
| type=raw,value=latest | |
| # Set up Docker Buildx | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3.7.1 | |
| - name: Build and Push Image | |
| uses: docker/build-push-action@v6.10.0 | |
| with: | |
| context: ./${{ matrix.app }} | |
| push: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags') }} | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: | | |
| org.opencontainers.image.source=${{ github.repository_url }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max |