From efafef7dbdd35625c05af9147473f7eff01ea21d Mon Sep 17 00:00:00 2001 From: flifloo Date: Fri, 16 Feb 2024 23:05:53 +0100 Subject: [PATCH] Simplify CI --- .forgejo/workflows/docker.yaml | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/.forgejo/workflows/docker.yaml b/.forgejo/workflows/docker.yaml index 1ba89c0..0750699 100644 --- a/.forgejo/workflows/docker.yaml +++ b/.forgejo/workflows/docker.yaml @@ -24,19 +24,26 @@ jobs: id: env run: | echo "DOCKER_TAG=$DOCKER_REPOSITORY/$(echo "$GITHUB_REPOSITORY" | tr '[:upper:]' '[:lower:]'):latest" >> "$GITHUB_ENV" - apk add --no-cache git nodejs + apk add --no-cache git nodejs zstd - name: "Login to Docker repository" - id: login - run: docker login -u "$GITHUB_ACTOR" -p "${{ secrets.PACKAGE_TOKEN }}" "$DOCKER_REPOSITORY" + uses: https://github.com/docker/login-action@v3 + with: + registry: "${{ env.DOCKER_REPOSITORY }}" + username: "${{ env.GITHUB_ACTOR }}" + password: "${{ secrets.PACKAGE_TOKEN }}" - - name: "Get repo" - uses: https://code.forgejo.org/actions/checkout@v4 + - name: "Cache Docker image" + uses: https://code.forgejo.org/actions/cache@v3 + with: + path: "${{ env.GITHUB_WORKSPACE }}/.docker_cache" + key: "docker" - - name: "Build Docker image" - id: build - run: docker buildx build --pull --platform linux/amd64 -t "$DOCKER_TAG" . - - - name: "Publish Docker image" - id: push - run: docker push "$DOCKER_TAG" + - name: "Build and push" + uses: https://github.com/docker/build-push-action@v5 + with: + context: . + push: true + tags: "${{ env.DOCKER_TAG }}" + cache-from: "type=local,dest=${{ env.GITHUB_WORKSPACE }}/.docker_cache" + cache-to: "type=local,dest=${{ env.GITHUB_WORKSPACE }}/.docker_cache"