75 lines
No EOL
2.4 KiB
YAML
75 lines
No EOL
2.4 KiB
YAML
image: ruby:3.1
|
|
|
|
variables:
|
|
JEKYLL_ENV: production
|
|
LC_ALL: C.UTF-8
|
|
|
|
before_script:
|
|
- bundle install
|
|
|
|
test:
|
|
stage: test
|
|
script:
|
|
- bundle exec jekyll build -d test
|
|
artifacts:
|
|
paths:
|
|
- test
|
|
except:
|
|
- butter-box
|
|
|
|
# This includes 3 separate builds.
|
|
# The main one is for the GitLab pages deployment. It includes a simulated USB Butter drive.
|
|
# The other two are for the downloadable zips of the site in English and Spanish.
|
|
pages:
|
|
stage: deploy
|
|
script:
|
|
- apt-get update
|
|
- apt-get install -y zip
|
|
# Build the default EN version
|
|
- sed -i "s/REPLACEME/butterbox/g" _data/deployment.yml
|
|
- bundle exec jekyll build -d public
|
|
- cd public
|
|
- zip -r ../site-en.zip ./
|
|
- cd ..
|
|
- git restore .
|
|
- rm -rf public/*
|
|
# Build the ES version (TODO: use a single build for all deployments)
|
|
- "sed -i 's/^languages:.*/languages: [\"es\", \"en\", \"fr_SN\", \"pt_AO\"]/g' ../butter-box-ui/_config.yml"
|
|
- sed -i "s/REPLACEME/comolamantequilla/g" _data/deployment.yml
|
|
- bundle exec jekyll build -d public
|
|
- cd public
|
|
- zip -r ../site-es.zip ./
|
|
- cd ..
|
|
- git restore .
|
|
# Now go build the site we actually want to deploy.
|
|
# simulate the drive being inserted
|
|
- mv simulated-usb-butter usb-butter
|
|
- "sed -i 's/^baseurl.*/baseurl: \"\\/butter-box-ui\"/' _config.yml"
|
|
- "sed -i 's/^usb_butter_url.*/usb_butter_url: \"\\/butter-box-ui\\/usb-butter\\/\"/' _config.yml"
|
|
- bundle exec jekyll build -d public
|
|
# Get the latest build of the FDroid PWA for butter
|
|
- curl https://likebutter.gitlab.io/fdroid-webdash-butter/demo.zip -o demo.zip
|
|
- unzip demo.zip
|
|
- mkdir -p public/usb-butter/appstore
|
|
- mv build/web/* public/usb-butter/appstore
|
|
- rm -rf build
|
|
- rm -f demo.zip
|
|
# Get a sample app store, the same one we refer to in documentation
|
|
- curl -L "https://www.dropbox.com/scl/fi/r6dpqa9ugli0v23ox3ho5/repo.zip?rlkey=oxc50ne9runw1bkb1fm3zy5r3&dl=1" -o repo.zip
|
|
- unzip repo.zip
|
|
- mkdir -p public/usb-butter/appstore/fdroid
|
|
- mv repo public/usb-butter/appstore/fdroid
|
|
- rm -f repo.zip
|
|
# Now move the zip into the public dir so it gets served.
|
|
- mv ./site-en.zip ./public/site-en.zip
|
|
- mv ./site-es.zip ./public/site-es.zip
|
|
- pwd
|
|
- ls -la .
|
|
- du -sh ./*
|
|
- du -sh ./public/*
|
|
- du -sh ./public/es/*
|
|
artifacts:
|
|
paths:
|
|
- public
|
|
only:
|
|
- butter-box |