feature: update dependencies of all the things #113
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
| # Runs on pull requests to main when there are changes to the service files in services/ | |
| # Lints and Unit tests the services that have changed | |
| name: Service CI | |
| on: | |
| pull_request: | |
| branches: [main] | |
| paths: ["services/**"] | |
| push: | |
| branches: [main] | |
| tags: ["v*"] | |
| paths: ["services/**"] | |
| env: | |
| NODE_VERSION: 22.x | |
| REGISTRY: ghcr.io | |
| jobs: | |
| changes: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| matrix-include: ${{ steps.set-matrix.outputs.filtered }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v2 | |
| - name: Check for changes | |
| uses: dorny/paths-filter@v3 | |
| id: filter | |
| with: | |
| filters: .github/filters.yml | |
| - name: Filter service values based on code changes | |
| id: set-matrix | |
| uses: './.github/actions/filter-options' | |
| with: | |
| options: .github/service-values.yml | |
| options-to-select: ${{ steps.filter.outputs.changes }} | |
| lint-and-test: | |
| runs-on: ubuntu-latest | |
| needs: changes | |
| strategy: | |
| matrix: | |
| include: ${{ fromJSON(needs.changes.outputs.matrix-include) }} | |
| defaults: | |
| run: | |
| working-directory: ${{ matrix.context }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v2 | |
| - name: Use Node.js ${{ env.NODE_VERSION }} | |
| uses: actions/setup-node@v1 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - name: Install NPM Dependencies | |
| run: npm ci --quiet | |
| - name: Lint Code | |
| run: npm run checkstyle:ci | |
| - name: Unit Test | |
| run: npm run test-ci | |
| - name: Extract metadata (tags, labels) for Docker | |
| id: meta | |
| uses: docker/metadata-action@v3 | |
| with: | |
| images: ${{ env.REGISTRY }}/${{ matrix.image }} | |
| tags: | | |
| type=sha | |
| type=ref,event=pr | |
| - name: Log in to the Container registry | |
| uses: docker/login-action@v1 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v2 | |
| with: | |
| context: ${{ matrix.context }} | |
| push: ${{ github.event_name != 'pull_request' }} | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} |