mirror of
https://github.com/drillster/drone-rsync.git
synced 2026-06-04 18:24:07 +08:00
fix github actions workflow, update alpine base version to 3.20, fix ignore pattern in docs
This commit is contained in:
+10
-45
@@ -1,17 +1,9 @@
|
|||||||
name: Build and Publish the image
|
name: Build and publish the image
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
|
||||||
schedule:
|
|
||||||
- cron: '15 15 15 * *'
|
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
|
||||||
- master
|
- master
|
||||||
paths-ignore:
|
|
||||||
- .gitea/**
|
|
||||||
- .github/**
|
|
||||||
- .gitlib-ci.*
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
@@ -21,48 +13,21 @@ jobs:
|
|||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
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
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v3
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: Cache Docker layers
|
- name: Login to Docker Hub
|
||||||
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
|
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: docker.io
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
|
||||||
|
- name: Build and push
|
||||||
- name: Build and push Docker AMD64/ARM64 image for latest
|
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
platforms: linux/amd64,linux/arm64
|
||||||
file: Dockerfile
|
|
||||||
platforms: linux/amd64, linux/arm64
|
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: drillster/drone-rsync:latest
|
||||||
${{ 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
|
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ steps:
|
|||||||
- "app.tar.gz"
|
- "app.tar.gz"
|
||||||
- "app.tar.gz.md5"
|
- "app.tar.gz.md5"
|
||||||
exclude:
|
exclude:
|
||||||
- "**.*"
|
- "*"
|
||||||
prescript:
|
prescript:
|
||||||
- cd ~/packages
|
- cd ~/packages
|
||||||
- md5sum -c app.tar.gz.md5
|
- md5sum -c app.tar.gz.md5
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
FROM alpine:3.13
|
FROM alpine:3.20
|
||||||
|
|
||||||
RUN apk add --no-cache --update ca-certificates bash openssh-client rsync
|
RUN apk add --no-cache --update ca-certificates bash openssh-client rsync
|
||||||
COPY upload.sh /usr/local/
|
COPY upload.sh /usr/local/
|
||||||
|
|||||||
Reference in New Issue
Block a user