diff --git a/.github/workflows/build-and-push.yml b/.github/workflows/build-and-push.yml index 6d2b633..16e5b63 100644 --- a/.github/workflows/build-and-push.yml +++ b/.github/workflows/build-and-push.yml @@ -91,10 +91,11 @@ jobs: uses: 'docker/setup-buildx-action@v3' - name: 'Login to DockerHub' + if: ${{ github.event_name != 'pull_request' }} uses: 'docker/login-action@v3' with: - username: 'antmelekhin' - password: ${{ secrets.DOCKER_HUB_TOKEN }} + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} - name: 'Build and push ${{ matrix.tag }}' uses: 'docker/build-push-action@v6' @@ -104,5 +105,5 @@ jobs: context: . file: '${{ matrix.dockerfile }}' platforms: '${{ matrix.platforms }}' - push: true - tags: 'antmelekhin/docker-systemd:${{ matrix.tag }}' + push: ${{ github.event_name != 'pull_request' }} + tags: '${{ github.repository }}:${{ matrix.tag }}' diff --git a/.github/workflows/dockerhub-description.yml b/.github/workflows/dockerhub-description.yml index 58d88c1..9519356 100644 --- a/.github/workflows/dockerhub-description.yml +++ b/.github/workflows/dockerhub-description.yml @@ -15,7 +15,7 @@ jobs: - name: 'DockerHub Description' uses: 'peter-evans/dockerhub-description@v4' with: - username: 'antmelekhin' - password: ${{ secrets.DOCKER_HUB_TOKEN }} + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} short-description: ${{ github.event.repository.description }} enable-url-completion: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e5f1235..c899473 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,15 +1,16 @@ --- name: 'Release' on: - push: + workflow_run: + workflows: ['Build docker images'] + types: ['completed'] branches: ['main'] jobs: release: name: 'Release' runs-on: 'ubuntu-latest' - # Skip running release workflow on forks - if: github.repository_owner == 'antmelekhin' + if: ${{ github.repository_owner == 'antmelekhin' && github.event.workflow_run.conclusion == 'success' }} steps: - name: 'Checkout the codebase' uses: 'actions/checkout@v4'