Merge pull request #270 from StefRuseva88/npm_and_yarn/undici-7.24.1 #404
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: Packaging | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: Build and Test | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Use Node.js 20.x | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 20.x | |
| cache: npm | |
| - run: npm ci | |
| env: | |
| CYPRESS_INSTALL_BINARY: 0 | |
| - run: npm run build --if-present | |
| - run: npm test | |
| - name: Report Coverage | |
| uses: davelosert/vitest-coverage-report-action@v2 | |
| if: always() | |
| package-and-publish: | |
| needs: | |
| - build | |
| name: 🐳 Package & Publish | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ github.event.pull_request.head.ref || 'main' }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Docker Login | |
| uses: docker/login-action@v4.0.0 | |
| with: | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| registry: ghcr.io | |
| - name: Generate Docker Metadata | |
| id: meta | |
| uses: docker/metadata-action@v6 | |
| with: | |
| images: ghcr.io/${{ github.repository }} | |
| tags: | | |
| type=ref,event=tag | |
| type=ref,event=pr | |
| type=sha,event=branch,prefix=,format=short | |
| - name: Build and Push Docker Image | |
| uses: docker/build-push-action@v7 | |
| with: | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max |