No pipeline shown

I am using GitLab to host a webpage. Following GitLab’s instructions, I pushed a .gitlab-ci.yml file. But, there is no pipeline shown and therefore no GitLab CI/CD task runs. I search on Google and looked for all the mistakes I could had made but I made none of them. I also deleted the file and reapplied it but it didn’t work.

Can you share your .gitlab-ci.yml please ?

Sure!

pages:
    stage: deploy
    script:
        - wget https://github.com/rust-lang/mdBook/releases/download/v0.4.15/mdbook-v0.4.15-x86_64-unknown-linux-gnu.tar.gz
        - tar xvzf mdbook-v0.4.15-x86_64-unknown-linux-gnu.tar.gz
        - ./mdbook build
    artifacts:
        paths:
            - public
    only:
        - master

And, here is where I found the template.

It is probably the branch name. What is the name of your main branch ? master or main ? If it is main you should replace master with main in the ci file.

pages:
    stage: deploy
    script:
        - wget https://github.com/rust-lang/mdBook/releases/download/v0.4.15/mdbook-v0.4.15-x86_64-unknown-linux-gnu.tar.gz
        - tar xvzf mdbook-v0.4.15-x86_64-unknown-linux-gnu.tar.gz
        - ./mdbook build
    artifacts:
        paths:
            - public
    only:
        - main

The name is main, therefore this is not the cause of the problem.

Make sure it is also main in your ci file.

    only:
        - main

if it still doesn’t show up. try removing the only:-main and check if it works now.

That fixed the problem.
It now runs the pipeline.

Thank you!