Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: BREAKING CHANGE - overhaul #68

Draft
wants to merge 60 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
86a60b0
feat: Added new processes
dsavell Feb 17, 2024
bac365e
feat: Added new processes
dsavell Feb 17, 2024
2472e81
adding all the linters
dsavell Feb 17, 2024
2c98fda
adding all the linters
dsavell Feb 17, 2024
df0c83e
adding all the linters
dsavell Feb 17, 2024
2a46c95
adding all the linters
dsavell Feb 17, 2024
2caab06
adding all the linters
dsavell Feb 17, 2024
4eb9c18
adding all the linters
dsavell Feb 17, 2024
c028831
feat: BREAKING CHANGE - overhaul dsavell/grav
dsavell Feb 19, 2024
6aa3ed1
feat: BREAKING CHANGE - overhaul dsavell/grav
dsavell Feb 19, 2024
94a7fb4
feat: BREAKING CHANGE - overhaul dsavell/grav
dsavell Feb 19, 2024
65aa37f
Correct markdown length
dsavell Feb 19, 2024
9932473
Correct markdown length
dsavell Feb 19, 2024
66cdbd9
Correct markdown length
dsavell Feb 19, 2024
39bd6e1
fix: shellcheck linting
dsavell Feb 19, 2024
a753763
feat: update linting
dsavell Feb 19, 2024
1e8d533
feat: added logging
dsavell Feb 20, 2024
cfbea40
renamed nginx & added shellcheck config
dsavell Feb 20, 2024
d1b0843
renamed nginx & added shellcheck config
dsavell Feb 20, 2024
091b4e5
added some CI steps
dsavell Feb 20, 2024
107ac77
testing
dsavell Feb 20, 2024
4123173
feat: more testing
dsavell Feb 20, 2024
713792a
feat: more testing
dsavell Feb 20, 2024
1a55d95
feat: more testing
dsavell Feb 20, 2024
29c15af
feat: more testing
dsavell Feb 20, 2024
dce5e1b
feat: more testing
dsavell Feb 20, 2024
8014533
feat: more testing
dsavell Feb 20, 2024
bb7bbc6
feat: more testing
dsavell Feb 20, 2024
c2d73b6
feat: more testing
dsavell Feb 20, 2024
d80769f
feat: more testing
dsavell Feb 20, 2024
6241f5c
feat: more testing
dsavell Feb 20, 2024
4b50d4e
feat: more testing
dsavell Feb 20, 2024
0d91eca
feat: correct port listening test
dsavell Feb 21, 2024
6aff596
feat: correct port listening test
dsavell Feb 21, 2024
9eecc8e
feat: correct port listening test
dsavell Feb 21, 2024
e8882a0
feat: fix frontpage access test
dsavell Feb 21, 2024
3b8a08c
feat: fix frontpage access test
dsavell Feb 21, 2024
0e5f787
feat: fix frontpage access test
dsavell Feb 21, 2024
caa481f
added back robots.txt
dsavell Feb 22, 2024
d5b971f
added back robots.txt
dsavell Feb 22, 2024
0155a32
added back robots.txt
dsavell Feb 22, 2024
8e5bdc2
added back robots.txt
dsavell Feb 22, 2024
d7966d5
added back robots.txt
dsavell Feb 22, 2024
055353f
added back robots.txt
dsavell Feb 22, 2024
2fc1a71
feat: correct init scripts
dsavell Feb 24, 2024
86800b8
feat: backup function
dsavell Feb 24, 2024
c490733
feat: backup function
dsavell Feb 24, 2024
1a59291
spliting workflows
dsavell Feb 24, 2024
4102b30
feat: overhaul
dsavell Feb 25, 2024
63afdd0
feat: overhaul
dsavell Feb 25, 2024
960786b
feat: overhaul
dsavell Feb 25, 2024
79d268e
feat: overhaul
dsavell Feb 25, 2024
11f3299
feat: overhaul
dsavell Feb 25, 2024
f1d5d1a
feat: overhaul
dsavell Feb 25, 2024
6afa8a4
feat: overhaul
dsavell Feb 25, 2024
656f431
feat: overhaul
dsavell Feb 25, 2024
7ac4e42
feat: overhaul
dsavell Feb 25, 2024
2180fdc
set platform for CI pipeline build
dsavell Feb 25, 2024
c17b9c3
missing linebreak
dsavell Feb 25, 2024
da929c8
feat: added multisite
dsavell Feb 25, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
PUID=1000
PGID=1000
TZ=Europe/London

NGINX_CLIENT_MAX_BODY_SIZE=32m
ROBOTS_DISALLOW=false

GRAV_PLUGINS=admin
GRAV_MULTISITE=none
1 change: 0 additions & 1 deletion .github/CONTRIBUTING.md

This file was deleted.

38 changes: 0 additions & 38 deletions .github/PULL_REQUEST_TEMPLATE.md

This file was deleted.

159 changes: 55 additions & 104 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,137 +1,88 @@
---
name: Build

on:
schedule:
# Everyday at 01:00am
- cron: '0 1 * * *'
on: # yamllint disable-line rule:truthy
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main

concurrency:
group: build-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
docker-validate:
strategy:
matrix:
tag: [core, admin]
timeout-minutes: 10
build-test:
name: Build & Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Run Docker Lint
uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: Dockerfile.grav${{ matrix.tag }}

docker-build-pr:
if: github.event_name == 'pull_request'
needs:
- docker-validate
strategy:
matrix:
tag: [core, admin]
timeout-minutes: 10
runs-on: ubuntu-latest
platform: [amd64, arm64]
steps:
- name: Checkout code
- name: Checkout
uses: actions/checkout@v4

- name: Get Date
run: |
DATE=$(date +"%Y%m%d")
echo "${DATE}"
echo "DATE=${DATE}" >> $GITHUB_ENV

- name: Get GRAV Version
run: |
GRAV_VERSION=$(curl -sL "https://github.com/gitapi/repos/getgrav/grav/releases/latest" | grep tag_name | cut -d '"' -f 4)
echo "${GRAV_VERSION}"
echo "GRAV_VERSION=${GRAV_VERSION}" >> $GITHUB_ENV

- name: Generate Docker Metadata
id: docker-meta
uses: docker/metadata-action@v5
with:
images: |
dsavell/grav
tags: |
type=raw,value=${{ matrix.tag }}
type=raw,value=${{ matrix.tag }}-${{ env.GRAV_VERSION }}
type=raw,value=${{ matrix.tag }}-${{ env.DATE }}
type=raw,value=${{ matrix.tag }}-${{ env.GRAV_VERSION }}-${{ env.DATE }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build only
- name: Docker - Build
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.grav${{ matrix.tag }}
push: false
tags: ${{ steps.docker-meta.outputs.tags }}
labels: ${{ steps.docker-meta.outputs.labels }}
file: ./Dockerfile
platforms: linux/${{ matrix.platform }}
load: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ github.run_id }}:${{ matrix.platform }}
build-args: |
GRAV_VERSION=${{ env.GRAV_VERSION }}

docker-build-main:
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
needs:
- docker-validate
strategy:
matrix:
tag: [core, admin]
timeout-minutes: 10
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Get Date
- name: Docker - Run
run: |
DATE=$(date +"%Y%m%d")
echo "${DATE}"
echo "DATE=${DATE}" >> $GITHUB_ENV
docker run -d \
--platform linux/${{ matrix.platform }} \
--name=grav_test \
-p 127.0.0.1:80:80/tcp \
--env-file .env.example \
-v ./grav/backup:/grav/backup \
-v ./grav/user:/grav/user \
${{ github.run_id }}:${{ matrix.platform }}

- name: Get GRAV Version
- name: Test - Listening Port 80
run: |
GRAV_VERSION=$(curl -sL "https://github.com/gitapi/repos/getgrav/grav/releases/latest" | grep tag_name | cut -d '"' -f 4)
echo "${GRAV_VERSION}"
echo "GRAV_VERSION=${GRAV_VERSION}" >> $GITHUB_ENV
sleep 5s
nc -z -v 127.0.0.1 80 || exit 1

- name: Generate Docker Metadata
id: docker-meta
uses: docker/metadata-action@v5
with:
images: |
dsavell/grav
tags: |
type=raw,value=${{ matrix.tag }}
type=raw,value=${{ matrix.tag }}-${{ env.GRAV_VERSION }}
type=raw,value=${{ matrix.tag }}-${{ env.DATE }}
type=raw,value=${{ matrix.tag }}-${{ env.GRAV_VERSION }}-${{ env.DATE }}
- name: Test - Webpage access
run: |
sleep 20s
if curl -v --silent 127.0.0.1:80/admin | grep Grav; then
echo "Grav webpage accessible"
else
exit 2
fi

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Test - Update plugins function
run: |
if docker exec grav_test update-plugins | grep 'Nothing to update'; then
echo "Grav update plugins function OK"
else
exit 3
fi

- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.grav${{ matrix.tag }}
push: true
tags: ${{ steps.docker-meta.outputs.tags }}
labels: ${{ steps.docker-meta.outputs.labels }}
build-args: |
GRAV_VERSION=${{ env.GRAV_VERSION }}
- name: Test - Backup function
run: |
if docker exec grav_test backup | grep 'Backup Successfully Created'; then
echo "Grav backup successfull"
else
exit 4
fi
63 changes: 63 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
---
name: Lint

on: # yamllint disable-line rule:truthy
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main

concurrency:
group: lint-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
shellcheck:
name: Shellcheck
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Run Shellcheck
uses: ludeeus/action-shellcheck@2.0.0

markdownlint:
name: Markdownlint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Run Markdownlint
uses: DavidAnson/markdownlint-cli2-action@v15
with:
config: '.markdownlint.jsonc'
globs: '**/*.md'

yamllint:
name: Yamllint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Run Yamllint
uses: ibiqlik/action-yamllint@v3
with:
config_file: .yamllint.yml

dockerlint:
name: Dockerlint
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Run Hadolint
uses: hadolint/hadolint-action@v3.1.0
with:
dockerfile: Dockerfile
71 changes: 71 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
---
name: Release

on: # yamllint disable-line rule:truthy
schedule:
- cron: '0 1 * * 0' # At 01:00 on Sunday
workflow_dispatch:
push:
branches:
- main

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Get Date
run: |
DATE=$(date +"%Y%m%d")
echo "${DATE}"
echo "DATE=${DATE}" >> $GITHUB_ENV

- name: Get GRAV Version
run: |
GRAV_VERSION=$(curl -sL "https://github.com/gitapi/repos/getgrav/grav/releases/latest" | grep tag_name | cut -d '"' -f 4)
echo "${GRAV_VERSION}"
echo "GRAV_VERSION=${GRAV_VERSION}" >> $GITHUB_ENV

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Generate Docker Metadata
id: docker-meta
uses: docker/metadata-action@v5
with:
images: |
dsavell/grav
ghcr.io/dsavell/grav
tags: |
type=raw,value=${{ env.GRAV_VERSION }}
type=raw,value=${{ env.GRAV_VERSION }}-${{ env.DATE }}

- name: Docker - Build & Push
uses: docker/build-push-action@v5
with:
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.docker-meta.outputs.tags }}
labels: ${{ steps.docker-meta.outputs.labels }}
build-args: |
GRAV_VERSION=${{ env.GRAV_VERSION }}
Loading