diff --git a/Dockerfile b/Dockerfile index 306f8b0..5c9f6c7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,13 @@ # Container image that runs your code FROM alpine:3.12 -RUN apk update \ - && apk add --no-cache wget \ - && wget -O upx.tar.gz http://collection.b0.upaiyun.com/softwares/upx/upx_0.3.6_linux_x86_64.tar.gz \ - && tar -zxf upx.tar.gz \ - && chmod +x upx +# Container image that runs your code +FROM alpine:3.12 + +# Copies your code file from your action repository to the filesystem path `/` of the container +COPY entrypoint.sh /entrypoint.sh + +RUN chmod +x /entrypoint.sh + +# Code file to execute when the docker container starts up (`entrypoint.sh`) +ENTRYPOINT ["/entrypoint.sh"] \ No newline at end of file diff --git a/action.yml b/action.yml index b4534b5..0cc55c1 100644 --- a/action.yml +++ b/action.yml @@ -11,11 +11,11 @@ inputs: UP_OPERATOR_PASSWORD: description: '操作员密码' required: true - local_path: + LOCAL_PATH: description: 'will put all file under this path' required: true default: ./public/* - remote_path: + REMOTE_PATH: description: 'files will copy to under remote_path' required: true default: / diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100644 index 0000000..8c90d67 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,15 @@ +#!/bin/sh -l + +apk update \ + && apk add --no-cache wget \ + && wget -O upx.tar.gz http://collection.b0.upaiyun.com/softwares/upx/upx_0.3.6_linux_x86_64.tar.gz \ + && tar -zxf upx.tar.gz \ + && chmod +x upx \ + && mv upx /usr/local/bin/upx + +### 执行upx upload +upx login "${BUCKET_NAME}" "${UPX_NAME}" "${UPX_PASSWORD}" +echo "start upx upload!" +upx sync ${LOCAL_PATH} ${REMOTE_PATH} --delete +echo "upx upload successful!" +upx logout \ No newline at end of file