My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

[YAML] Confusing relative paths in deploying the site. I want to deploy site without the folder "public" in GitLab?

Gustavo Benedito Costa's photo
Gustavo Benedito Costa
·Dec 6, 2019

Hello!

I built a YAML file. GitLab is very confused with the absolute or relative paths and does not detect the files and the images from the folder assets.

Here is:

pages:
  stage: deploy
  script:
    - echo "Olá Felipe e Daniel! :-)"
  artifacts:
    paths:
    - public
  only:
  - gusbemacbe

I want to deploy a site without the folder public and change public to ., I am not sure if it will work. Here is the tree:

repository
├── public
│   ├── 404.html
│   ├── assets
│   │   ├── css
│   │   ├── fonts
│   │   ├── images
│   │   └── js
│   ├── index.html
│   └── nbproject
│       ├── private
│       │   ├── private.properties
│       │   └── private.xml
│       ├── project.properties
│       └── project.xml

Here is small CSS snippet:

.about 
{
    background-image: url('/assets/images/quem-somos@1.jpg');
    background-size: cover;
    background-position: center;
    text-align: center;
    padding: 25px 0px 20px 0px;
}

And small HTML snippet:

<!DOCTYPE html>
<html lang="pt-BR">
    <head>
        <link rel="icon" href="./assets/images/favicons/favicon.ico" />
        <link rel="stylesheet" media='all' type="text/css" href="./assets/css/font-awesome.css">
        <link rel="stylesheet" media='all' type="text/css" href="./assets/css/style.css">
        <link rel="stylesheet" media='all' type="text/css" href="./assets/css/media-queries.css">
    <body>
       <a class="navbar-brand" href="index.html">
          <img src="./assets/images/logotipo.svg" width="30" height="30" alt="">
       </a>

        <script src="./assets/js/jquery.js"></script>
        <script src="./assets/js/popper.js"></script>
        <script src="./assets/js/bootstrap.bundle.js"></script>

        <script src="./assets/js/firebase/firebase-app.js"></script>
        <script src="./assets/js/firebase/firebase-analytics.js"></script>

        <script src="./assets/js/firebase/firebase-firestore.js"></script>
        <script src="./assets/js/firebase/firebase-storage.js"></script>

    </body>
</html>