From 25ded3bfe10eaff372f3892af6b8d4db6c3df498 Mon Sep 17 00:00:00 2001 From: Michael de Wit Date: Thu, 21 Nov 2024 14:47:43 +0100 Subject: [PATCH] fix github actions workflow, update alpine base version to 3.20, fix ignore pattern in docs --- .github/workflows/build.yml | 55 +++++++------------------------------ DOCS.md | 2 +- Dockerfile | 2 +- 3 files changed, 12 insertions(+), 47 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fb2854b..fa21dca 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,17 +1,9 @@ -name: Build and Publish the image +name: Build and publish the image on: - workflow_dispatch: - schedule: - - cron: '15 15 15 * *' push: branches: - - main - master - paths-ignore: - - .gitea/** - - .github/** - - .gitlib-ci.* jobs: release: @@ -21,48 +13,21 @@ jobs: - name: Checkout uses: actions/checkout@v4 - - name: Set RELEASE_DATE - run: | - echo "RELEASE_DATE=$(date --rfc-3339=date)" >> ${GITHUB_ENV} - echo "REPO_NAME=$(echo ${{ github.repository }} | sed -E 's,.+/([^/]+),\1,')" >> ${GITHUB_ENV} - - name: Set up QEMU uses: docker/setup-qemu-action@v3 - + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - - - name: Cache Docker layers - uses: actions/cache@v4 - with: - path: | - /tmp/.buildx-cache.latest - key: ${{ runner.os }}-buildx-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-buildx- - - - name: Login to registry + + - name: Login to Docker Hub uses: docker/login-action@v3 with: - registry: docker.io - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - - name: Build and push Docker AMD64/ARM64 image for latest + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push uses: docker/build-push-action@v6 with: - context: . - file: Dockerfile - platforms: linux/amd64, linux/arm64 + platforms: linux/amd64,linux/arm64 push: true - tags: | - ${{ secrets.DOCKER_REPO }}/${{ github.event.repository.name }}:latest - ${{ secrets.DOCKER_REPO }}/${{ github.event.repository.name }}:${{ env.RELEASE_DATE }} - cache-from: type=local,src=/tmp/.buildx-cache.latest - cache-to: type=local,dest=/tmp/.buildx-cache-new.latest - - - name: Rotate the cache for latest - run: | - rm -rf /tmp/.buildx-cache.latest - mv /tmp/.buildx-cache-new.latest /tmp/.buildx-cache.latest - + tags: drillster/drone-rsync:latest diff --git a/DOCS.md b/DOCS.md index 6e9839b..8690c2e 100644 --- a/DOCS.md +++ b/DOCS.md @@ -68,7 +68,7 @@ steps: - "app.tar.gz" - "app.tar.gz.md5" exclude: - - "**.*" + - "*" prescript: - cd ~/packages - md5sum -c app.tar.gz.md5 diff --git a/Dockerfile b/Dockerfile index c08288a..a16faa7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:3.13 +FROM alpine:3.20 RUN apk add --no-cache --update ca-certificates bash openssh-client rsync COPY upload.sh /usr/local/