diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml deleted file mode 100644 index 3f1d5c3..0000000 --- a/.github/workflows/publish.yaml +++ /dev/null @@ -1,65 +0,0 @@ ---- -name: Build & Publish container -"on": - push: - branches: [main] - -jobs: - build_and_publish: - name: Build & Publish to GitHub Container Registry - runs-on: ubuntu-latest - permissions: - contents: write - packages: write - steps: - - name: Code checkout - uses: actions/checkout@v3 - with: - repository: ${{ github.event.pull_request.head.repo.full_name }} - ref: ${{ github.event.pull_request.head.ref }} - - - name: Docker metadata - id: meta - uses: docker/metadata-action@v4 - with: - images: ghcr.io/${{ github.repository }} - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Setup buildx - uses: docker/setup-buildx-action@v2 - with: - install: true - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Bump version and push tag - id: tag_version - uses: mathieudutour/github-tag-action@v6.1 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - dry_run: false - - - name: Build and push - uses: docker/build-push-action@v4 - with: - context: . - platforms: linux/amd64,linux/arm64 - push: true - tags: | - ${{ steps.meta.outputs.tags }} - ghcr.io/${{ github.repository }}:${{ steps.tag_version.outputs.new_tag }} - labels: ${{ steps.meta.outputs.labels }} - - - name: Create a GitHub release - uses: ncipollo/release-action@v1.12.0 - with: - tag: ${{ steps.tag_version.outputs.new_tag }} - name: Release ${{ steps.tag_version.outputs.new_tag }} - body: ${{ steps.tag_version.outputs.changelog }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..d389c1e --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,9 @@ +--- +name: Build & Publish container +"on": + push: + branches: [main] + +jobs: + publish: + uses: actionshub/reusable-workflows/.github/workflows/publish.yaml@cce19fb345836ccd29168d876a8a8eca454fb27a diff --git a/.github/workflows/pull_request.yaml b/.github/workflows/pull_request.yaml deleted file mode 100644 index c320c26..0000000 --- a/.github/workflows/pull_request.yaml +++ /dev/null @@ -1,69 +0,0 @@ ---- -name: Build & Publish container -"on": - pull_request: - -jobs: - build_and_publish: - name: Build & Publish to GitHub Container Registry - runs-on: ubuntu-latest - permissions: - contents: write - packages: write - steps: - - name: Code checkout - uses: actions/checkout@v3 - with: - repository: ${{ github.event.pull_request.head.repo.full_name }} - ref: ${{ github.event.pull_request.head.ref }} - - - name: Docker metadata - id: meta - uses: docker/metadata-action@v4 - with: - images: ghcr.io/${{ github.repository }} - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Setup buildx - uses: docker/setup-buildx-action@v2 - with: - install: true - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Bump version and push tag - id: tag_version - uses: mathieudutour/github-tag-action@v6.1 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - dry_run: true - - - name: Update actions.yml to ${{ steps.tag_version.outputs.new_tag }} - uses: mikefarah/yq@v4.30.8 - with: - cmd: yq e -i '.runs.image = "docker://ghcr.io/${{ github.repository }}:${{ steps.tag_version.outputs.new_tag }}"' action.yml - - - name: Commit Changes to actions.yml - uses: EndBug/add-and-commit@v9 - with: - message: "Update actions.yml to ${{ steps.tag_version.outputs.new_tag }}" - add: "action.yml" - default_author: github_actions - - - name: Build and push - uses: docker/build-push-action@v4 - with: - context: . - platforms: linux/amd64,linux/arm64 - push: true - tags: | - ${{ steps.meta.outputs.tags }} - ghcr.io/${{ github.repository }}:${{ steps.tag_version.outputs.new_tag }} - labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml new file mode 100644 index 0000000..d5ff8f9 --- /dev/null +++ b/.github/workflows/pull_request.yml @@ -0,0 +1,7 @@ +--- +name: Build & Publish container +"on": + pull_request: +jobs: + pull_request: + uses: actionshub/reusable-workflows/.github/workflows/pull_request.yaml@cce19fb345836ccd29168d876a8a8eca454fb27a diff --git a/action.yml b/action.yml index d8370ad..2736ee1 100644 --- a/action.yml +++ b/action.yml @@ -14,4 +14,4 @@ outputs: description: "stdout from mdl" runs: using: "docker" - image: "docker://ghcr.io/actionshub/markdownlint:v3.1.2" + image: "docker://ghcr.io/actionshub/markdownlint:v3.1.3"