Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Teardown shows 'FAIL ---> Site not found.', but the site exists #115

Open
54853315 opened this issue Sep 18, 2024 · 1 comment
Open

Teardown shows 'FAIL ---> Site not found.', but the site exists #115

54853315 opened this issue Sep 18, 2024 · 1 comment

Comments

@54853315
Copy link

54853315 commented Sep 18, 2024

I noticed that there are undeleted preview sites in Forge. Immediately checking the execution logs of Actions shows: FAIL ---> Site not found.

QQ_1726648762438

preview-teardown.yml

name: preview-teardown
on:
  pull_request:
    branches: [dev]
    types: [closed]
jobs:
  harbor-teardown:
    if: |
      github.event.pull_request.draft == false
    runs-on: ubuntu-latest
    container:
      image: kirschbaumdevelopment/laravel-test-runner:8.1
    steps:
      - name: Set FORGE_SUBDOMAIN_PATTERN if head_ref starts with 't'
        if: startsWith(github.head_ref, 't')
        run: echo "FORGE_SUBDOMAIN_PATTERN=/^(t\d{3,8})-(?:.*-.*)/i" >> $GITHUB_ENV
      - name: Install Harbor
        run: composer global require mehrancodes/laravel-harbor -q
      - name: Start Teardown Preview Site
        env:
          FORGE_TOKEN: ${{ secrets.FORGE_API_TOKEN }}
          FORGE_SERVER: ${{ secrets.FORGE_DEV_SERVER_ID }}
          FORGE_GIT_REPOSITORY: ${{ github.repository }}
          FORGE_GIT_BRANCH: ${{ github.head_ref }}
          FORGE_DOMAIN: domain.com
        run: |
          harbor teardown

Please note that my laravel-harbor usesFORGE_SUBDOMAIN_PATTERN to determine the subdomain style based on the branch name:

  • It prioritizes matching branch names like "t12345-a-b-c-d", and the domain will be: t12345.domain.com
  • If the above branch name is not found, it directly uses the branch name as the domain: branch-name.domain.com

QQ_1726648839934

In the :Start Teardown Preview Site step, when printing the environment variables, FORGE_SUBDOMAIN_PATTERN appears, indicating that the condition in the above step: Set FORGE_SUBDOMAIN_PATTERN if head_ref starts with 't' is met. Therefore, a FORGE_SUBDOMAIN_PATTERN is inserted into GitHub's environment variables to ensure the correct subdomain can be found during the teardown phase.

QQ_1726648256423


So I simulated the content of this Pull Request locally and executed it using theact tool. Surprisingly, it executed successfully!

I'm not sure if this is a bug related to the subdomain?

QQ_1726648984669

QQ_1726648953661

@dev-anthonyrae
Copy link

I have a related / similar issue with the site directory not being removed
#114

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants