CI: speed up build

This commit is contained in:
2026-05-08 22:00:28 +00:00
committed by David Zálešák
parent 9d9e76e2d0
commit 935c59dd8b
2 changed files with 27 additions and 23 deletions

View File

@@ -35,29 +35,11 @@ jobs:
# If using the 'assets' git submodule from Chirpy Starter, uncomment above
# (See: https://github.com/cotes2020/chirpy-starter/tree/main/assets)
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.3
bundler-cache: true
- name: Build site
run: bundle exec jekyll b -d "_site${{ steps.pages.outputs.base_path }}"
env:
JEKYLL_ENV: "production"
- name: Test site
run: |
bundle exec htmlproofer _site \
\-\-disable-external \
\-\-ignore-urls "/^http:\/\/127.0.0.1/,/^http:\/\/0.0.0.0/,/^http:\/\/localhost/"
- name: Build Docker image
run: |
echo "FROM nginx:alpine" > Dockerfile
echo "COPY _site /usr/share/nginx/html" >> Dockerfile
echo "EXPOSE 80" >> Dockerfile
docker build -t ${CI_REGISTRY_IMAGE:-git.pixx.cz/${{ gitea.repository }}}:${{ gitea.sha }} .
docker build \
-t git.pixx.cz/${{ gitea.repository }}:${{ gitea.sha }} \
-t git.pixx.cz/${{ gitea.repository }}:latest .
- name: Login to Gitea Container Registry
run: |
@@ -66,8 +48,6 @@ jobs:
- name: Push Docker image
run: |
docker tag ${CI_REGISTRY_IMAGE:-git.pixx.cz/${{ gitea.repository }}}:${{ gitea.sha }} \
${CI_REGISTRY_IMAGE:-git.pixx.cz/${{ gitea.repository }}}:latest
docker push ${CI_REGISTRY_IMAGE:-git.pixx.cz/${{ gitea.repository }}}:${{ gitea.sha }}
docker push ${CI_REGISTRY_IMAGE:-git.pixx.cz/${{ gitea.repository }}}:latest