[PATCH v2 1/3] gitlab-ci: Configure website build to be published via gitlab pages

Peter Krempa posted 3 patches 1 year, 5 months ago
[PATCH v2 1/3] gitlab-ci: Configure website build to be published via gitlab pages
Posted by Peter Krempa 1 year, 5 months ago
On pushes to master publish the webpage (built in the 'website_job' job)
via gitlab pages. The 'pages' job uses the default image that gitlab
assumes as it's consuming artifacts from an existing job and naming
them properly.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 .gitlab-ci.yml | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 81433652ae..b0e2724706 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -6,6 +6,7 @@ stages:
   - builds
   - integration_tests
   - sanity_checks
+  - pages

 .script_variables: &script_variables |
   export CCACHE_BASEDIR="$(pwd)"
@@ -85,6 +86,23 @@ website_job:
     NAME: almalinux-8
     TARGET_BASE_IMAGE: docker.io/library/almalinux:8

+# On push to master publish the website from 'website_job' via gitlab pages
+pages:
+  stage: pages
+  script:
+    - mv website public
+  dependencies:
+    - website_job
+  rules:
+    - if: '$CI_PROJECT_NAMESPACE == $RUN_UPSTREAM_NAMESPACE && $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
+      when: on_success
+    - when: never
+  artifacts:
+    expose_as: 'pages'
+    name: 'pages'
+    paths:
+      - public
+
 .codestyle_job:
   stage: sanity_checks
   needs:
-- 
2.43.0
_______________________________________________
Devel mailing list -- devel@lists.libvirt.org
To unsubscribe send an email to devel-leave@lists.libvirt.org
Re: [PATCH v2 1/3] gitlab-ci: Configure website build to be published via gitlab pages
Posted by Daniel P. Berrangé 1 year, 5 months ago
On Fri, Jan 19, 2024 at 03:33:42PM +0100, Peter Krempa wrote:
> On pushes to master publish the webpage (built in the 'website_job' job)
> via gitlab pages. The 'pages' job uses the default image that gitlab
> assumes as it's consuming artifacts from an existing job and naming
> them properly.
> 
> Signed-off-by: Peter Krempa <pkrempa@redhat.com>
> ---
>  .gitlab-ci.yml | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>



With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
_______________________________________________
Devel mailing list -- devel@lists.libvirt.org
To unsubscribe send an email to devel-leave@lists.libvirt.org