diff --git a/.github/workflows/publish-image.yml b/.github/workflows/publish-image.yml index c1e4f4b6..bf2f4d8d 100644 --- a/.github/workflows/publish-image.yml +++ b/.github/workflows/publish-image.yml @@ -2,8 +2,6 @@ name: Publish OCI image on: push: - branches: - - main jobs: push_to_registry: @@ -13,7 +11,17 @@ jobs: - name: Check out the repo uses: actions/checkout@v3.3.0 + - name: Check if we need to login and if image should be pushed + id: push_check + run: | + if [[ "${{ github.ref }}" == refs/heads/main ]]; then + echo "::set-output name=push::true" + else + echo "::set-output name=push::false" + fi + - name: Log in to the Container registry + if: ${{ steps.push_check.outputs.push }} uses: docker/login-action@v2.1.0 with: registry: ghcr.io @@ -24,5 +32,5 @@ jobs: uses: docker/build-push-action@v3.2.0 with: context: . - push: true + push: ${{ steps.push_check.outputs.push }} tags: "ghcr.io/${{ github.repository }}:latest" diff --git a/samba.sh b/samba.sh index ebb4e20b..f66001dc 100755 --- a/samba.sh +++ b/samba.sh @@ -293,5 +293,5 @@ elif ps -ef | egrep -v grep | grep -q smbd; then echo "Service already running, please restart container to apply changes" else [[ ${NMBD:-""} ]] && ionice -c 3 nmbd -D - exec ionice -c 3 smbd -FS --no-process-group