Fix/error after vulnerabilities #8
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: PR pipeline | |
| on: | |
| pull_request: | |
| branches: | |
| - develop | |
| env: | |
| IMAGE_NAME: hsldevcom/hsl-map-server | |
| TEST_STAGE: tester | |
| PRODUCTION_STAGE: production | |
| jobs: | |
| build-check-test-push: | |
| name: Build, check, test, push | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| clean: 'true' | |
| fetch-depth: 2 | |
| - name: Setup Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build tester image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| load: true | |
| target: "${{ env.TEST_STAGE }}" | |
| tags: "${{ env.IMAGE_NAME }}:${{ env.TEST_STAGE }}" | |
| - name: Run checks and tests inside Docker | |
| run: docker run --rm "${{ env.IMAGE_NAME }}:${{ env.TEST_STAGE }}" | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKER_USER }} | |
| password: ${{ secrets.DOCKER_AUTH }} | |
| - name: Build and push production image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| push: true | |
| target: "${{ env.PRODUCTION_STAGE }}" | |
| tags: "${{ env.IMAGE_NAME }}:pr-${{ github.event.pull_request.number }}" |