chore: update gh actions to publish to docker

This commit is contained in:
synacktra.work@gmail.com 2025-11-12 15:29:11 +05:30
parent a01e6479b6
commit d872b73f57
9 changed files with 53 additions and 221 deletions

View File

@ -1,10 +0,0 @@
version: 2
updates:
- package-ecosystem: docker
directory: /
schedule:
interval: weekly
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly

View File

@ -1,4 +0,0 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["config:recommended", ":disableDependencyDashboard"]
}

BIN
.github/winboat.png vendored

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

View File

@ -1,103 +0,0 @@
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@v5
with:
fetch-depth: 0
-
name: Docker metadata
id: meta
uses: docker/metadata-action@v5
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@v3
-
name: Login into Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
-
name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Build Docker image
uses: docker/build-push-action@v6
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: Push to Gitlab mirror
uses: action-pack/gitlab-sync@v3
with:
url: ${{ secrets.GITLAB_URL }}
token: ${{ secrets.GITLAB_TOKEN }}
username: ${{ secrets.GITLAB_USERNAME }}
-
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.

View File

@ -4,7 +4,6 @@ permissions: {}
jobs:
shellcheck:
name: shellcheck
runs-on: ubuntu-latest
steps:
-
@ -31,5 +30,3 @@ jobs:
-
name: Validate JSON and YML files
uses: GrantBirki/json-yaml-validate@v4
with:
yaml_exclude_regex: ".*\\kubernetes\\.yml$"

View File

@ -1,24 +0,0 @@
name: Update
on:
push:
branches:
- master
paths:
- readme.md
- README.md
- .github/workflows/hub.yml
jobs:
dockerHubDescription:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
-
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

53
.github/workflows/publish-docker.yml vendored Normal file
View File

@ -0,0 +1,53 @@
name: Docker Build and Push
on:
release:
types: [created]
jobs:
shellcheck:
uses: ./.github/workflows/check.yml
build-and-push:
needs: shellcheck
runs-on: ubuntu-latest
permissions:
actions: write
packages: write
contents: read
steps:
-
name: Checkout
uses: actions/checkout@v5
with:
fetch-depth: 0
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
-
name: Login into Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
-
name: Extract version from release
id: version_tag
run: |
# Extract the version from the release tag, removing any 'v' prefix
VERSION_TAG="${GITHUB_REF#refs/tags/}"
CLEAN_VERSION=$(echo "$VERSION_TAG" | sed 's/^v//')
echo "##[set-output name=version;]${CLEAN_VERSION}"
-
name: Build and push version tag
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/windows-local:${{ steps.version_tag.outputs.version }}
-
name: Build and push latest tag
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ secrets.DOCKER_USERNAME }}/windows-local:latest

View File

@ -1,66 +0,0 @@
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@v5
-
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: DL3006 DL3008
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 }}

View File

@ -1,11 +0,0 @@
on:
workflow_dispatch:
pull_request:
name: "Test"
permissions: {}
jobs:
shellcheck:
name: Test
uses: ./.github/workflows/check.yml