@@ -44,6 +44,8 @@ We provide you with a template to accomplish this task easily.
44
44
Create a file called ` .gitlab-ci.yml ` in the root directory of your
45
45
repository and copy the contents of the template below.
46
46
47
+ Make sure you specify a version of Zola in the ` ZOLA_VERSION ` variable.
48
+
47
49
``` yaml
48
50
stages :
49
51
- deploy
@@ -56,9 +58,9 @@ variables:
56
58
# set to "recursive".
57
59
GIT_SUBMODULE_STRATEGY : " recursive"
58
60
59
- # If you don't set a version here, your site will be built with the latest
60
- # version of Zola available in GitHub releases .
61
- # Use the semver (x.y.z) format to specify a version. For example: "0.17.2" or "0.18.0".
61
+ # Make sure you specify a version of Zola here.
62
+ # Use the semver format (x.y.z) to specify a version .
63
+ # For example: "0.17.2" or "0.18.0".
62
64
ZOLA_VERSION :
63
65
description : " The version of Zola used to build the site."
64
66
value : " "
@@ -67,30 +69,20 @@ pages:
67
69
stage : deploy
68
70
script :
69
71
- |
70
- apt-get update --assume-yes && apt-get install --assume-yes --no-install-recommends wget ca-certificates
71
- if [ $ZOLA_VERSION ]; then
72
- zola_url="https://github.com/getzola/zola/releases/download/v$ZOLA_VERSION/zola-v$ZOLA_VERSION-x86_64-unknown-linux-gnu.tar.gz"
73
- if ! wget --quiet --spider $zola_url; then
74
- echo "A Zola release with the specified version could not be found.";
75
- exit 1;
76
- fi
77
- else
78
- github_api_url="https://api.github.com/repos/getzola/zola/releases/latest"
79
- zola_url=$(
80
- wget --output-document - $github_api_url |
81
- grep "browser_download_url.*x86_64.*linux-gnu.tar.gz" |
82
- cut --delimiter : --fields 2,3 |
83
- tr --delete "\" "
84
- )
72
+ apt-get update
73
+ DEBIAN_FRONTEND=noninteractive apt-get install --assume-yes --no-install-recommends wget ca-certificates
74
+ zola_url="https://github.com/getzola/zola/releases/download/v${ZOLA_VERSION}/zola-v${ZOLA_VERSION}-x86_64-unknown-linux-gnu.tar.gz"
75
+ if ! wget --quiet --spider $zola_url; then
76
+ echo "A Zola release with the specified version could not be found."
77
+ exit 1
85
78
fi
86
79
wget $zola_url
87
80
tar -xzf *.tar.gz
88
81
./zola build --base-url $CI_PAGES_URL
89
82
90
83
artifacts :
91
84
paths :
92
- # This is the directory whose contents will be deployed to the GitLab Pages
93
- # server.
85
+ # This is the directory whose contents will be deployed to the GitLab Pages server.
94
86
# GitLab Pages expects a directory with this name by default.
95
87
- public
96
88
0 commit comments