不忘初心 2 years ago
parent d3ec296d1e
commit 3f8a17f502

@ -1,12 +1,17 @@
# Container image that runs your code
FROM alpine:3.12 FROM alpine:3.12
RUN apk --no-cache add wget curl bash # Copies your code file from your action repository to the filesystem path `/` of the container
COPY entrypoint.sh /entrypoint.sh
# Make sure to make you entrypoint.sh file executable:
RUN chmod +x entrypoint.sh
RUN wget -O upx.tar.gz http://collection.b0.upaiyun.com/softwares/upx/upx_0.3.6_linux_x86_64.tar.gz \ 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 \ && tar -zxf upx.tar.gz \
&& mv upx /usr/local/bin/upx \ && mv upx /usr/local/bin/upx \
&& chmod +x /usr/local/bin/upx && chmod +x /usr/local/bin/upx
COPY entrypoint.sh /entrypoint.sh # Code file to execute when the docker container starts up (`entrypoint.sh`)
ENTRYPOINT ["/entrypoint.sh"] ENTRYPOINT ["/entrypoint.sh"]

@ -2,15 +2,24 @@ name: 'upyun-upx-action'
author: 'YaoKun <yaokun@bwcxtech.com>' author: 'YaoKun <yaokun@bwcxtech.com>'
description: 'Deploy your files to upyun using upyun-upx.' description: 'Deploy your files to upyun using upyun-upx.'
inputs: inputs:
UP_BUCKET: up_bucket:
description: '服务名' description: '服务名'
required: true required: true
UP_OPERATOR: up_operator:
description: '操作员' description: '操作员'
required: true required: true
UP_OPERATOR_PASSWORD: up_operator_password:
description: '操作员密码' description: '操作员密码'
required: true required: true
local_path:
description: 'will put all file under this path'
required: true
default: ./public/*
remote_path:
description: 'files will copy to under remote_path'
required: true
default: /
runs: runs:
using: 'docker' using: 'docker'
image: 'Dockerfile' image: 'Dockerfile'

@ -1,3 +1,13 @@
#!/bin/bash #!/bin/sh -l
upx login ${{ secrets.UP_BUCKET }} ${{ secrets.UP_OPERATOR }} ${{ secrets.UP_OPERATOR_PASSWORD }} #set -e at the top of your script will make the script exit with an error whenever an error occurs (and is not explicitly handled)
set -eu
upx login $1 $2 $3
upx sync $4 $5 --delete
upx logout
echo 'Deploy Success'
exit 0
Loading…
Cancel
Save