2222 - name : build site
2323 run : bundle exec jekyll build --limit-posts 10
2424 docker-build :
25- permissions :
26- contents : read
27- packages : write
2825 runs-on : ubuntu-22.04
2926 name : Dockerised Jekyll Build
3027 steps :
@@ -34,40 +31,18 @@ jobs:
3431 uses : dorny/paths-filter@v3
3532 with :
3633 filters : |
37- rebuild:
38- - 'Dockerfile'
39- - 'Gemfile'
40- - 'Gemfile.lock'
41- - '.github/workflows/ci.yml'
4234 diff_gemfile:
4335 - 'Gemfile.lock'
44- - name : ghcr login
45- uses : docker/login-action@v3
46- with :
47- registry : ghcr.io
48- username : ${{ github.actor }}
49- password : ${{ secrets.GITHUB_TOKEN }}
50- - name : monero-site ruby build env (pull or build)
36+ - name : Build ruby env
5137 run : |
52- tag_name="ghcr.io/${GITHUB_REPOSITORY_OWNER}/monero-site-ruby:latest"
53- case "${{ steps.changes.outputs.rebuild }}" in
54- "true")
55- docker build -t "$tag_name" .
56- ;;
57- *)
58- docker pull "$tag_name" || docker build -t "$tag_name" .
59- ;;
60- esac
38+ docker build -t monero-site-ruby:latest .
6139 - name : Build Jekyll site with Docker
62- run : docker run -v $(pwd):/srv/jekyll ghcr.io/${GITHUB_REPOSITORY_OWNER}/monero-site-ruby:latest bundle exec jekyll build --limit-posts 10
63- - name : Push new image to ghcr
64- if : github.event_name == 'push' && github.ref == 'refs/heads/master'
65- run : docker push -a ghcr.io/${GITHUB_REPOSITORY_OWNER}/monero-site-ruby
40+ run : docker run -v $(pwd):/srv/jekyll monero-site-ruby:latest bundle exec jekyll build --limit-posts 10
6641 - name : Confirm Gemfile update
6742 if : steps.changes.outputs.diff_gemfile == 'true'
6843 run : |
6944 cp Gemfile.lock Gemfile.lock.update
70- docker run -v $(pwd):/srv/jekyll ghcr.io/${GITHUB_REPOSITORY_OWNER}/ monero-site-ruby bundle update
45+ docker run -v $(pwd):/srv/jekyll monero-site-ruby:latest bundle update
7146 if ! diff Gemfile.lock Gemfile.lock.update; then
7247 echo "Gemfile.lock updates do not match"
7348 exit 1
0 commit comments