diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..f08cd93 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,10 @@ +version: 2 +updates: + - package-ecosystem: docker + directory: / + schedule: + interval: weekly + - package-ecosystem: github-actions + directory: / + schedule: + interval: weekly diff --git a/.github/logo.png b/.github/logo.png new file mode 100644 index 0000000..38b628e Binary files /dev/null and b/.github/logo.png differ diff --git a/.github/renovate.json b/.github/renovate.json new file mode 100644 index 0000000..cc31624 --- /dev/null +++ b/.github/renovate.json @@ -0,0 +1,4 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": ["config:recommended", ":disableDependencyDashboard"] +} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..cfc1e53 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,96 @@ +name: Build + +on: + workflow_dispatch: + +concurrency: + group: build + cancel-in-progress: false + +jobs: + shellcheck: + name: Test + uses: ./.github/workflows/check.yml + build: + name: Build + needs: shellcheck + runs-on: ubuntu-latest + permissions: + actions: write + packages: write + contents: read + steps: + - + name: Checkout + uses: actions/checkout@v6 + with: + fetch-depth: 0 + - + name: Docker metadata + id: meta + uses: docker/metadata-action@v6 + with: + context: git + images: | + ${{ secrets.DOCKERHUB_REPO }} + ghcr.io/${{ github.repository }} + tags: | + type=raw,value=latest,priority=100 + type=raw,value=${{ vars.MAJOR }}.${{ vars.MINOR }} + labels: | + org.opencontainers.image.title=${{ vars.NAME }} + env: + DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,index + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v4 + - + name: Login into Docker Hub + uses: docker/login-action@v4 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + - + name: Login to GitHub Container Registry + uses: docker/login-action@v4 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - + name: Build Docker image + uses: docker/build-push-action@v7 + with: + context: . + push: true + provenance: false + platforms: linux/amd64,linux/arm64 + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + annotations: ${{ steps.meta.outputs.annotations }} + build-args: | + VERSION_ARG=${{ steps.meta.outputs.version }} + - + name: Create a release + uses: action-pack/github-release@v2 + with: + tag: "v${{ steps.meta.outputs.version }}" + title: "v${{ steps.meta.outputs.version }}" + token: ${{ secrets.REPO_ACCESS_TOKEN }} + - + name: Increment version variable + uses: action-pack/bump@v2 + with: + token: ${{ secrets.REPO_ACCESS_TOKEN }} + - + name: Send mail + uses: action-pack/send-mail@v1 + with: + to: ${{secrets.MAILTO}} + from: Github Actions <${{secrets.MAILTO}}> + connection_url: ${{secrets.MAIL_CONNECTION}} + subject: Build of ${{ github.event.repository.name }} v${{ steps.meta.outputs.version }} completed + body: | + The build job of ${{ github.event.repository.name }} v${{ steps.meta.outputs.version }} was completed successfully! + + See https://github.com/${{ github.repository }}/actions for more information. diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000..2c1b883 --- /dev/null +++ b/.github/workflows/check.yml @@ -0,0 +1,25 @@ +on: [workflow_call] +name: "Check" +permissions: {} + +jobs: + shellcheck: + name: shellcheck + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - name: Run ShellCheck + uses: ludeeus/action-shellcheck@master + env: + SHELLCHECK_OPTS: -x --source-path=src -e SC1091 -e SC2001 -e SC2002 -e SC2034 -e SC2064 -e SC2153 -e SC2317 -e SC2028 + - name: Lint Dockerfile + uses: hadolint/hadolint-action@v3.3.0 + with: + dockerfile: Dockerfile + ignore: DL3008,DL3018,DL3020,DL3029,DL3059 + failure-threshold: warning + - + name: Validate JSON and YML files + uses: GrantBirki/json-yaml-validate@v5.0.0 + with: + yaml_exclude_regex: ".*\\kubernetes\\.yml$" diff --git a/.github/workflows/hub.yml b/.github/workflows/hub.yml new file mode 100644 index 0000000..7a54a82 --- /dev/null +++ b/.github/workflows/hub.yml @@ -0,0 +1,26 @@ +name: Update +on: + push: + branches: + - master + paths: + - readme.md + - README.md + - .github/workflows/hub.yml + +jobs: + dockerHubDescription: + runs-on: ubuntu-latest + steps: + - + name: Checkout repo + uses: actions/checkout@v6 + - + name: Docker Hub Description + uses: peter-evans/dockerhub-description@v5 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + repository: ${{ secrets.DOCKERHUB_REPO }} + short-description: ${{ github.event.repository.description }} + readme-filepath: ./readme.md diff --git a/.github/workflows/review.yml b/.github/workflows/review.yml new file mode 100644 index 0000000..19d1e1b --- /dev/null +++ b/.github/workflows/review.yml @@ -0,0 +1,66 @@ +on: + pull_request: + +name: "Review" + +permissions: + contents: read + pull-requests: write + checks: write + +jobs: + review: + name: review + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v6 + - + name: Spelling + uses: reviewdog/action-misspell@v1 + with: + locale: "US" + level: warning + pattern: | + *.md + *.sh + reporter: github-pr-review + github_token: ${{ secrets.GITHUB_TOKEN }} + - + name: Hadolint + uses: reviewdog/action-hadolint@v1 + with: + level: warning + reporter: github-pr-review + hadolint_ignore: DL3008 DL3018 DL3020 DL3029 DL3059 + github_token: ${{ secrets.GITHUB_TOKEN }} + - + name: YamlLint + uses: reviewdog/action-yamllint@v1 + with: + level: warning + reporter: github-pr-review + github_token: ${{ secrets.GITHUB_TOKEN }} + - + name: ActionLint + uses: reviewdog/action-actionlint@v1 + with: + level: warning + reporter: github-pr-review + github_token: ${{ secrets.GITHUB_TOKEN }} + - + name: Shellformat + uses: reviewdog/action-shfmt@v1 + with: + level: warning + shfmt_flags: "-i 2 -ci -bn" + github_token: ${{ secrets.GITHUB_TOKEN }} + - + name: Shellcheck + uses: reviewdog/action-shellcheck@v1 + with: + level: warning + reporter: github-pr-review + shellcheck_flags: -x -e SC1091 -e SC2001 -e SC2002 -e SC2034 -e SC2064 -e SC2153 -e SC2317 -e SC2028 + github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..c275f1a --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,11 @@ +on: + workflow_dispatch: + pull_request: + +name: "Test" +permissions: {} + +jobs: + shellcheck: + name: Test + uses: ./.github/workflows/check.yml