publish to ghcr.io

This commit is contained in:
Ruben Fiszel
2022-08-10 03:11:24 +02:00
parent c11055bd83
commit 34f8a4df4b
+14 -3
View File
@@ -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