diff --git a/.github/workflows/docker-image-dev.yml b/.github/workflows/docker-image-dev.yml index c1740eb..04bd8e7 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@main + 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 153bc4b..c8da872 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{{version}} - type=semver,pattern=v{{major}} - 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@main + 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 }} \ No newline at end of file diff --git a/.github/workflows/readme-update.yml b/.github/workflows/readme-update.yml index ad79409..8f33e9b 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@main + secrets: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}