From 938fa728e72cf3cbad5c11c285a55c6621752285 Mon Sep 17 00:00:00 2001 From: bertybuttface <110790513+bertybuttface@users.noreply.github.com> Date: Sun, 8 Jan 2023 17:03:39 +0000 Subject: [PATCH] Update github actions to use cache and latest tag --- .github/workflows/main.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5ae21c0..8af7edb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -4,9 +4,9 @@ on: push: tags: - "v*.*.*" + branches: [main] pull_request: - branches: - - "main" + branches: [main] jobs: docker: @@ -23,6 +23,7 @@ jobs: # list of Docker images to use as base name for tags images: | ghcr.io/matrixgpt/matrix-chatgpt-bot + flavor: latest=true # generate Docker tags based on the following events/attributes tags: | type=schedule @@ -51,7 +52,9 @@ jobs: uses: docker/build-push-action@v3 with: context: . - push: ${{ github.event_name != 'pull_request' }} + push: ${{ github.ref_type == 'tag' }} tags: ${{ steps.meta.outputs.tags }} - platforms: linux/amd64,linux/arm64 labels: ${{ steps.meta.outputs.labels }} + platforms: linux/amd64,linux/arm64 + cache-from: type=gha + cache-to: type=gha,mode=max