Merge pull request #631 from ansforge/feature/lrm-datetime-today-button #26
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: Build LRM images | |
| on: | |
| push: | |
| tags: | |
| - 'lrm-*' | |
| workflow_dispatch: | |
| jobs: | |
| get-tag: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| version: ${{ steps.extract-lrm-version.outputs.version }} | |
| steps: | |
| - name: Extract version from tag | |
| id: extract-lrm-version | |
| run: | | |
| TAG_NAME="${{ github.ref_name }}" | |
| VERSION=${TAG_NAME#lrm-} | |
| PATTERN="^([0-9]+\.[0-9]+(\.[0-9]+)?)(-[A-Za-z0-9\.]+)*$" | |
| if [[ ! "$VERSION" =~ $PATTERN ]]; then | |
| echo "Invalid version number" | |
| echo $VERSION | |
| exit 1 | |
| fi | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| build-images: | |
| needs: get-tag | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - name: 'hub-lrm-back' | |
| context: './web/lrm/server' | |
| - name: 'hub-lrm-front' | |
| context: './web/lrm/client' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v5 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| push: true | |
| platforms: linux/amd64 | |
| tags: ghcr.io/${{ github.repository_owner }}/${{ matrix.name }}:${{ needs.get-tag.outputs.version }} | |
| context: ${{ matrix.context }} | |
| # image-security-scan: | |
| # name: Scan Docker Images | |
| # needs: [get-tag, build-images] | |
| # runs-on: ubuntu-latest | |
| # continue-on-error: true | |
| # strategy: | |
| # fail-fast: false | |
| # matrix: | |
| # include: | |
| # - name: 'hub-lrm-back' | |
| # folder: './web/lrm/server' | |
| # - name: 'hub-lrm-front' | |
| # folder: './web/lrm/client' | |
| # steps: | |
| # - name: Checkout | |
| # uses: actions/checkout@v5 | |
| # - name: Login to Container Registry | |
| # uses: docker/login-action@v3 | |
| # with: | |
| # registry: ghcr.io | |
| # username: ${{ github.actor }} | |
| # password: ${{ secrets.GITHUB_TOKEN }} | |
| # - name: Scan Dispatcher Docker image | |
| # uses: aquasecurity/trivy-action@0.33.1 | |
| # with: | |
| # image-ref: 'ghcr.io/${{ github.repository_owner }}/${{ matrix.name }}:${{ needs.get-tag.outputs.version }}' | |
| # format: 'table' | |
| # severity: 'HIGH,CRITICAL' | |
| # exit-code: '1' | |
| # trivyignores: '${{ matrix.folder }}/.trivyignore' |