diff --git a/.github/workflows/auto-release.yml b/.github/workflows/auto-release.yml index 6a2d30b..98c8663 100644 --- a/.github/workflows/auto-release.yml +++ b/.github/workflows/auto-release.yml @@ -16,4 +16,4 @@ jobs: prerelease: false config-name: auto-release.yml env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }} diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index dc310e0..686a9b7 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -1,8 +1,5 @@ name: "docker" on: - push: - branches: - - master pull_request: types: [opened, synchronize, reopened] release: @@ -15,7 +12,7 @@ jobs: - name: "Checkout source code at current commit" uses: actions/checkout@v2 - name: Prepare tags for Docker image - if: (github.event_name != 'pull_request' && github.ref == 'master') || github.event.pull_request.head.repo.full_name == github.repository + if: (github.event_name == 'release' && github.event.action == 'created') || github.event.pull_request.head.repo.full_name == github.repository id: prepare run: | TAGS=${{ github.repository }}:sha-${GITHUB_SHA:0:7} @@ -34,7 +31,7 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 - name: Login to DockerHub - if: (github.event_name != 'pull_request' && github.ref == 'master') || github.event.pull_request.head.repo.full_name == github.repository + if: (github.event_name == 'release' && github.event.action == 'created') || github.event.pull_request.head.repo.full_name == github.repository uses: docker/login-action@v1 with: username: ${{ secrets.DOCKERHUB_USERNAME }} @@ -43,5 +40,5 @@ jobs: id: docker_build uses: docker/build-push-action@v2 with: - push: ${{ (github.event_name != 'pull_request' && github.ref == 'master') || github.event.pull_request.head.repo.full_name == github.repository }} + push: ${{ (github.event_name == 'release' && github.event.action == 'created') || github.event.pull_request.head.repo.full_name == github.repository }} tags: ${{ steps.prepare.outputs.tags }}