chore(server): add createError with statusCode 403 test #91
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
| # Based On: https://github.com/marketplace/actions/build-and-push-docker-images | |
| name: Docker build and push to docker hub on tag | |
| on: | |
| release: | |
| types: [published] | |
| push: | |
| tags: | |
| - 'v*' | |
| branches: | |
| - main | |
| jobs: | |
| tests: | |
| timeout-minutes: 60 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: lts/* | |
| - name: Install dependencies | |
| run: npm install --production=false | |
| - name: Install Playwright Browsers | |
| run: npx playwright install --with-deps | |
| - name: Start Docker Compose services | |
| working-directory: ./docs/development | |
| run: docker compose up -d | |
| - name: Add a balanced channel to the environment | |
| working-directory: ./docs/development | |
| run: chmod +x add-balanced-channel.sh && ./add-balanced-channel.sh | |
| - name: Fix LND file permissions | |
| run: sudo chmod -R 755 ./data | |
| - name: Run Playwright tests | |
| run: npx playwright test | |
| - uses: actions/upload-artifact@v4 | |
| if: ${{ !cancelled() }} | |
| with: | |
| name: playwright-report | |
| path: playwright-report/ | |
| retention-days: 5 | |
| - name: Cleanup Docker Compose | |
| if: always() | |
| working-directory: ./docs/development | |
| run: docker compose down | |
| docker: | |
| needs: tests | |
| if: | | |
| contains(github.event.head_commit.message, 'RUN_PIPELINE') || | |
| github.event_name == 'release' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/[email protected] | |
| - name: Extract version from package.json & short commit hash & check for RUN_PIPELINE in commit message | |
| id: extract_version | |
| run: | | |
| VERSION=$(jq -r '.version' package.json) | |
| SHORT_HASH=$(git rev-parse --short HEAD) | |
| if echo "${{ github.event.head_commit.message }}" | grep -q "RUN_PIPELINE"; then | |
| echo "version=${VERSION}.${SHORT_HASH}" >> $GITHUB_OUTPUT | |
| else | |
| echo "version=${VERSION}" >> $GITHUB_OUTPUT | |
| fi | |
| - name: if RUN_PIPELINE, add special-version to package.json | |
| run: | | |
| if echo "${{ github.event.head_commit.message }}" | grep -q "RUN_PIPELINE"; then | |
| jq '.meta["special-version"] = "${{ steps.extract_version.outputs.version }}"' package.json > package.tmp.json && mv package.tmp.json package.json | |
| fi | |
| - name: Set up Docker Buildx | |
| uses: docker/[email protected] | |
| - name: Login to Docker Hub | |
| uses: docker/[email protected] | |
| with: | |
| username: ${{ vars.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_ACCESS_TOKEN }} | |
| - name: Build and push | |
| uses: docker/[email protected] | |
| with: | |
| context: . | |
| push: true | |
| tags: | | |
| ${{ vars.IMAGE_TAG }}:latest | |
| ${{ vars.IMAGE_TAG }}:v${{ steps.extract_version.outputs.version }} |