diff --git a/.github/docker-build-and-push/action.yml b/.github/docker-build-and-push/action.yml new file mode 100644 index 000000000..3fb525b84 --- /dev/null +++ b/.github/docker-build-and-push/action.yml @@ -0,0 +1,36 @@ +# Not used here but in other repos +name: Docker Build and Push +description: Docker Build and Push + +runs: + using: composite + steps: + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to Github Container Registry + uses: docker/login-action@v2 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ github.token }} + + - name: Generate Docker tags + uses: docker/metadata-action@v4 + id: metadata + with: + images: ghcr.io/${{ github.repository }} + tags: | + type=sha,format=long,prefix= + flavor: | + latest=true + + - name: Build and push + uses: docker/build-push-action@v4 + with: + push: true + tags: ${{ steps.metadata.outputs.tags }} + labels: ${{ steps.metadata.outputs.labels }} + + cache-from: type=gha + cache-to: type=gha,mode=max