diff --git a/.github/workflows/publish-docker-image.yml b/.github/workflows/publish-container.yml similarity index 59% rename from .github/workflows/publish-docker-image.yml rename to .github/workflows/publish-container.yml index c86a62f..360e24d 100644 --- a/.github/workflows/publish-docker-image.yml +++ b/.github/workflows/publish-container.yml @@ -1,23 +1,21 @@ -name: Publish Docker Image +name: Publish container on: - push: - branches: - - master + release: + types: [published] jobs: - docker-hub-push: - name: Push Docker image to Docker Hub + publish-ghcr: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 - - name: Docker meta - id: meta + - name: Gather metadata + id: metadata uses: docker/metadata-action@v4 with: - images: zetifi/docker-irestarter + images: ghcr.io/zetifi/docker-irestarter tags: | type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} @@ -29,18 +27,20 @@ jobs: with: platforms: linux/arm64/v8,linux/amd64 - - name: Log in to Docker Hub + - name: Login to GitHub Container Registry uses: docker/login-action@v2 with: - username: ${{ secrets.DOCKER_HUB_USERNAME }} - password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.github_token }} - name: Build and push uses: docker/build-push-action@v3 with: push: true - tags: ${{ steps.meta.outputs.tags }}, zetifi/docker-irestarter:latest - labels: ${{ steps.meta.outputs.labels }} + context: . platforms: linux/arm64/v8,linux/amd64 + labels: ${{ steps.metadata.outputs.labels }} + tags: ${{ steps.metadata.outputs.tags }}, ghcr.io/zetifi/docker-irestarter:latest cache-from: type=gha cache-to: type=gha,mode=max \ No newline at end of file