diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 78aeb8f..929d177 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -1,18 +1,23 @@ -name: Docker Image CI +name: Publish Docker Image on: - push: - branches: [ "development" ] pull_request: branches: [ "development" ] - + types: + - closed jobs: - - build: - + publish-docker-image: + if: github.event.pull_request.merged == true runs-on: ubuntu-latest - steps: - uses: actions/checkout@v3 + - name: Login to GitHub Container Registry + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} - name: Build the Docker image - run: docker build . --file Dockerfile --tag my-image-name:$(date +%s) + run: | + docker build . --tag ghcr.io/${{secrets.DOCKER_USER}}/domoticz-google-assistant:latest + docker push ghcr.io/${{secrets.DOCKER_USER}}/domoticz-google-assistant:latest