2024-05-15 07:22:46 +00:00
|
|
|
name: Jekyll
|
|
|
|
run-name: ${{ gitea.actor }} is running some Gitea Actions 🚀
|
|
|
|
on: [push]
|
|
|
|
|
|
|
|
jobs:
|
2024-05-15 07:44:19 +00:00
|
|
|
test-ci-actions:
|
2024-05-22 10:23:10 +00:00
|
|
|
runs-on: ubuntu-22.04
|
2024-05-15 07:22:46 +00:00
|
|
|
steps:
|
|
|
|
- name: Check out repository code
|
2024-05-15 07:44:19 +00:00
|
|
|
id: checkout
|
2024-05-15 07:22:46 +00:00
|
|
|
uses: actions/checkout@v4
|
2024-05-22 12:57:55 +00:00
|
|
|
- name: Fix file permissions
|
|
|
|
id: fix_permissions
|
|
|
|
run: |
|
2024-05-22 13:00:16 +00:00
|
|
|
export uid=1000
|
|
|
|
export gid=1000
|
|
|
|
export user=ubuntu
|
|
|
|
export group=ubuntu
|
|
|
|
id ${user} > /dev/null 2>&1 && \
|
|
|
|
{ groupmod -g "${gid}" "${group}" && usermod -md /home/${user} -s /bin/bash -g "${group}" -u "${uid}" "${user}"; } || \
|
|
|
|
{ groupadd -g "${gid}" "${group}" && useradd -md /home/${user} -s /bin/bash -g "${group}" -u "${uid}" "${user}"; }
|
2024-05-22 12:57:55 +00:00
|
|
|
chown -R ubuntu:ubuntu .
|
2024-05-15 07:57:11 +00:00
|
|
|
- name: Install docker
|
|
|
|
id: install_docker
|
|
|
|
run: |
|
2024-05-22 11:52:09 +00:00
|
|
|
apt-get -q update
|
|
|
|
apt-get -q install -y docker-compose
|
|
|
|
apt-get -q clean
|
2024-05-15 07:57:11 +00:00
|
|
|
- name: Verify docker
|
2024-05-15 07:44:19 +00:00
|
|
|
id: verify_docker
|
|
|
|
run: |
|
|
|
|
docker run --rm hello-world:latest > /dev/null
|
|
|
|
docker rmi hello-world:latest > /dev/null
|
|
|
|
docker version
|
|
|
|
docker compose version
|
2024-05-22 13:58:38 +00:00
|
|
|
docker volume ls
|
2024-05-22 12:30:15 +00:00
|
|
|
- name: Build Jekyll image
|
|
|
|
id: build_image
|
|
|
|
run: |
|
2024-05-22 12:50:47 +00:00
|
|
|
docker-compose build jekyll
|
2024-05-22 13:47:42 +00:00
|
|
|
- name: Verify Jekyll container
|
|
|
|
id: verify_image
|
|
|
|
run: |
|
2024-05-22 14:13:01 +00:00
|
|
|
VOL=$(docker volume ls | grep -Po "GITEA-ACTIONS-TASK-[0-9]+_WORKFLOW-Jekyll_JOB-test-ci-actions$")
|
2024-05-22 14:21:19 +00:00
|
|
|
docker compose run --rm --entrypoint bash -v "${VOL}:/home/ubuntu/workspace" jekyll -c "whoami; pwd; ls -lA ."
|
2024-05-22 12:34:17 +00:00
|
|
|
- name: Build Jekyll site
|
2024-05-22 12:30:15 +00:00
|
|
|
id: build_site
|
|
|
|
run: |
|
2024-05-22 14:14:21 +00:00
|
|
|
VOL=$(docker volume ls | grep -Po "GITEA-ACTIONS-TASK-[0-9]+_WORKFLOW-Jekyll_JOB-test-ci-actions$")
|
2024-05-22 14:21:19 +00:00
|
|
|
docker compose run --rm -v "${VOL}:/home/ubuntu/workspace" jekyll build --verbose
|