From 3cba42c724b1e2fa1c1437a2749c5d2cfc2fcac3 Mon Sep 17 00:00:00 2001 From: CodeShell <122738806+CodeShellDev@users.noreply.github.com> Date: Sun, 22 Jun 2025 20:31:43 +0200 Subject: [PATCH 1/2] updated workflows --- .github/workflows/docker-image-dev.yml | 57 ++++++-------------------- .github/workflows/docker-image.yml | 57 ++++++-------------------- .github/workflows/readme-update.yml | 33 +++------------ 3 files changed, 30 insertions(+), 117 deletions(-) diff --git a/.github/workflows/docker-image-dev.yml b/.github/workflows/docker-image-dev.yml index c1740eb..c851522 100644 --- a/.github/workflows/docker-image-dev.yml +++ b/.github/workflows/docker-image-dev.yml @@ -1,51 +1,18 @@ name: Build & Push Dev Image on: - push: - branches: - - dev - -env: - USERNAME: ${{ github.repository_owner }} - IMAGE_NAME: ${{ github.repository }} - REGISTRY: ghcr.io + release: + types: [published] jobs: update: - runs-on: ubuntu-latest - - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - - name: Login to Registry - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: ${{ env.USERNAME }} - password: ${{ secrets.GH_PCKG_TOKEN }} - - - name: Setup QEMU - uses: docker/setup-qemu-action@v3 - - - name: Setup Buildx - uses: docker/setup-buildx-action@v3 - - - name: Extract Labels and Tags - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - flavor: | - latest=false - tags: | - type=raw,value=latest-dev - - - name: Build and Push Image - uses: docker/build-push-action@v6 - with: - context: . - platforms: linux/amd64, linux/arm64 - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - push: true + uses: codeshelldev/gh-actions/.github/workflows/docker-image.yaml + with: + registry: ghcr.io + flavor: | + latest=false + tags: | + type=sha + type=raw,value=latest-dev + secrets: + GH_PCKG_TOKEN: ${{ secrets.GH_PCKG_TOKEN }} diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 4c61d4a..5181c57 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -4,50 +4,17 @@ on: release: types: [published] -env: - USERNAME: ${{ github.repository_owner }} - IMAGE_NAME: ${{ github.repository }} - REGISTRY: ghcr.io - jobs: update: - runs-on: ubuntu-latest - - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - - name: Login to Registry - uses: docker/login-action@v3 - with: - registry: ${{ env.REGISTRY }} - username: ${{ env.USERNAME }} - password: ${{ secrets.GH_PCKG_TOKEN }} - - - name: Setup QEMU - uses: docker/setup-qemu-action@v3 - - - name: Setup Buildx - uses: docker/setup-buildx-action@v3 - - - name: Extract Labels and Tags - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - flavor: | - latest=false - tags: | - type=semver,pattern=v{{major}} - type=semver,pattern=v{{version}} - type=semver,pattern=v{{major}}.{{minor}} - type=semver,pattern=latest - - - name: Build and Push Image - uses: docker/build-push-action@v6 - with: - context: . - platforms: linux/amd64, linux/arm64 - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - push: true + uses: codeshelldev/gh-actions/.github/workflows/docker-image.yaml + with: + registry: ghcr.io + flavor: | + latest=false + tags: | + type=semver,pattern=v{{major}} + type=semver,pattern=v{{version}} + type=semver,pattern=v{{major}}.{{minor}} + type=semver,pattern=latest + secrets: + GH_PCKG_TOKEN: ${{ secrets.GH_PCKG_TOKEN }} diff --git a/.github/workflows/readme-update.yml b/.github/workflows/readme-update.yml index ad79409..6df2f62 100644 --- a/.github/workflows/readme-update.yml +++ b/.github/workflows/readme-update.yml @@ -3,32 +3,11 @@ name: Update README on: push: paths: - - "docker-compose.yaml" - - ".github/templates/README.template.md" + - docker-compose.yaml + - .github/templates/README.template.md jobs: - update-readme: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Replace File Placeholders in README - run: | - bash .github/helper-scripts/replace_placeholders.sh .github/templates/README.template.md README.md - - - name: Commit & Push README.md - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - git config user.name "github-actions[bot]" - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - - git add README.md - if git diff --cached --quiet; then - echo "No changes to commit." - else - git commit -m "Update README.md" - git push - fi + update: + uses: codeshelldev/gh-actions/.github/workflows/readme-update.yaml + secrets: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From f3d044bcfeb2436c48fa6bccb7bc60932d8af49e Mon Sep 17 00:00:00 2001 From: CodeShell <122738806+CodeShellDev@users.noreply.github.com> Date: Sun, 22 Jun 2025 20:32:30 +0200 Subject: [PATCH 2/2] added @main --- .github/workflows/docker-image-dev.yml | 2 +- .github/workflows/docker-image.yml | 2 +- .github/workflows/readme-update.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/docker-image-dev.yml b/.github/workflows/docker-image-dev.yml index c851522..04bd8e7 100644 --- a/.github/workflows/docker-image-dev.yml +++ b/.github/workflows/docker-image-dev.yml @@ -6,7 +6,7 @@ on: jobs: update: - uses: codeshelldev/gh-actions/.github/workflows/docker-image.yaml + uses: codeshelldev/gh-actions/.github/workflows/docker-image.yaml@main with: registry: ghcr.io flavor: | diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 5181c57..ab9ce66 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -6,7 +6,7 @@ on: jobs: update: - uses: codeshelldev/gh-actions/.github/workflows/docker-image.yaml + uses: codeshelldev/gh-actions/.github/workflows/docker-image.yaml@main with: registry: ghcr.io flavor: | diff --git a/.github/workflows/readme-update.yml b/.github/workflows/readme-update.yml index 6df2f62..8f33e9b 100644 --- a/.github/workflows/readme-update.yml +++ b/.github/workflows/readme-update.yml @@ -8,6 +8,6 @@ on: jobs: update: - uses: codeshelldev/gh-actions/.github/workflows/readme-update.yaml + uses: codeshelldev/gh-actions/.github/workflows/readme-update.yaml@main secrets: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}