Skip to content

Commit

Permalink
Merge pull request #5 from anvaari/modify-workflow
Browse files Browse the repository at this point in the history
Remove all registries except docker io
  • Loading branch information
anvaari authored Sep 6, 2023
2 parents 1d36cca + dc867a7 commit 5095ab7
Showing 1 changed file with 6 additions and 25 deletions.
31 changes: 6 additions & 25 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ on:
- LICENSE

jobs:
push_to_registries:
name: Push Docker image to multiple registries
push_to_dockerhub:
name: Push Docker image to dockerhub
runs-on: ubuntu-latest
permissions:
packages: write
Expand All @@ -31,30 +31,12 @@ jobs:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Log in to Quay Container registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: quay.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}

- name: Log in to GitHub Container registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3
with:
images: |
${{ github.repository }}
quay.io/${{ github.repository }}
ghcr.io/${{ github.repository }}
images: ${{ github.repository }}

- name: Build and push Docker images
uses: docker/build-push-action@v2
with:
Expand All @@ -69,15 +51,14 @@ jobs:
echo ::set-output name=PROJECT_NAME::${GITHUB_REF#refs/*/}
echo ::set-output name=PROJECT_BRANCH::${GITHUB_REF#refs/heads/}
echo ::set-output name=PROJECT_TAG::${GITHUB_REF#refs/tags/}
- name: Create Release
id: create_release
uses: ncipollo/release-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
body: |
Pull image:
* `docker pull ghcr.io/sentoz/kafka-connect-restart:${{ steps.env.outputs.PROJECT_TAG }}`
* `docker pull quay.io/sentoz/kafka-connect-restart:${{ steps.env.outputs.PROJECT_TAG }}`
* `docker pull docker.io/sentoz/kafka-connect-restart:${{ steps.env.outputs.PROJECT_TAG }}`
* `docker pull docker.io/anvaari/connector-guardian:${{ steps.env.outputs.PROJECT_TAG }}`
draft: false
prerelease: false

0 comments on commit 5095ab7

Please sign in to comment.