title: GitLab pages - how to use any repo name?
body: <p><strong>Question</strong></p>
  
  <p>I have a GitLab repo <code>XXX/website-www</code> which contains code to generate a static website.</p>
  
  <p>I am using GitLab CI for continuous integration/deployment.</p>
  
  <p>For now, I have decided to use GitLab pages to host my static website. This could easily change in the future.</p>
  
  <p>I found this simple configuration that I can add to my <code>.gitlab-ci.yml</code> file:</p>
  
  <pre><code>pages:
    stage: deploy
    script:
    - &lt;...&gt;
    artifacts:
      paths:
      - &lt;static_website_directory&gt;
    only:
    - master
  </code></pre>
  
  <p>This works nicely, but has one issue. The GitLab pages url is now <code>XXX.gitlab.io/website-www</code>.</p>
  
  <p>I need to be able to access this website from a custom domain, and from what I know, this can't be done with the above URL.</p>
  
  <p>I need to have something like <code>XXX-website-www.gitlab.io</code>.</p>
  
  <p><strong>Possible solutions</strong></p>
  
  <p>1) One way to obtain the url I need is by creating a a group named <code>XXX-website-www</code>, and inside, a repo named <code>XXX-website-www.gitlab.io</code>.</p>
  
  <p>This has a couple of problems:</p>
  
  <ol>
  <li>I have to create a brand new namespace for this website, which is separate from my main group namespace.</li>
  <li>As I said above, I could easily switch from GitLab pages to another static website provider at any stage and vice versa. Now my group/project names have to change just to allow for GitLab pages to function.</li>
  </ol>
  
  <p>2) Another solution would be to do repo mirroring. I would mirror <code>XXX-website-www/XXX-website-www.gitlab.io</code> from <code>XXX/website-www</code>, but I'm not even sure if you can mirror from another gitlab repo.</p>
  
  <p>This sadly has another problem: the continuous integration will fail on the <code>XXX/website-www</code> repo.</p>
  
  <p>How else can I achieve this?</p>
  
  <p>3) Another solution would be to create a separate <code>XXX-website-www/XXX-website-www.gitlab.io</code> repo alongside <code>XXX/website-www</code>.</p>
  
  <p>I would change the continuous integration for <code>XXX/website-www</code> to do a direct git add/commit/push to <code>XXX-website-www/XXX-website-www.gitlab.io</code>.</p>
  
  <p>I would then do an initial commit to <code>XXX-website-www/XXX-website.www.gitlab.io</code> with GitLab pages CI.</p>
  
  <p>This is quite a hassel, and still has the problem of number 1 above. It also seems messy working with git inside CI.</p>