diff --git a/.github/workflows/pypi_on_release.yml b/.github/workflows/pypi_on_release.yml index f5cd4dcaf4..dfd62d0d4a 100644 --- a/.github/workflows/pypi_on_release.yml +++ b/.github/workflows/pypi_on_release.yml @@ -1,5 +1,5 @@ env: - LOCAL_REGISTRY: registry.wimill.xyz + LOCAL_REGISTRY: ghcr.io IMAGE_NAME: ${{ github.repository }} name: Publish python-client @@ -31,6 +31,15 @@ jobs: fetch-depth: 0 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 + + - name: Login to registry + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + registry: ${{ env.LOCAL_REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Docker meta local id: metalocal uses: docker/metadata-action@v4 @@ -41,12 +50,14 @@ jobs: type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} - - name: Build and push + - name: Build and push publicly uses: docker/build-push-action@v3 + if: github.event_name != 'pull_request' with: context: "{{defaultContext}}:lsp" push: true - tags: ${{ steps.metalocal.outputs.tags }} + tags: | + ${{ env.LOCAL_REGISTRY }}/${{ env.IMAGE_NAME }}-lsp:latest labels: ${{ steps.metalocal.outputs.labels }} cache-from: type=registry,ref=${{ env.LOCAL_REGISTRY }}/${{ env.IMAGE_NAME }}-lsp:buildcache cache-to: type=registry,ref=${{ env.LOCAL_REGISTRY }}/${{ env.IMAGE_NAME }}-lsp:buildcache,mode=max