Skip to content

frp

frp #167

Workflow file for this run

name: frp
on:
# push:
# branches:
# - master
schedule:
- cron: "0 0 * * 1"
jobs:
frp:
runs-on: ubuntu-latest
steps:
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: actions/setup-node@main
- name: "get current version and latest version"
run: |
docker pull mebtte/frps
CURRENT_VERSION=$(docker run --rm mebtte/frps -v)
echo CURRENT_VERSION=$CURRENT_VERSION >> $GITHUB_ENV
LATEST_DESC=$(gh release list --repo fatedier/frp -L 50 --exclude-drafts --exclude-pre-releases | grep -i latest)
LATEST_VERSION=$(node -e "console.log('$LATEST_DESC'.split(/\s/)[0].replace('v',''))")
echo LATEST_VERSION=$LATEST_VERSION >> $GITHUB_ENV
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
- if: env.CURRENT_VERSION != env.LATEST_VERSION
uses: actions/checkout@main
- if: env.CURRENT_VERSION != env.LATEST_VERSION
name: "download and decompress latest version of frp"
working-directory: ./frp
run: |
mkdir -p cache
gh release download v${{env.LATEST_VERSION}} -D cache -p '*linux_amd64*' --repo fatedier/frp --skip-existing
tar -zxvf cache/frp_${{env.LATEST_VERSION}}_linux_amd64.tar.gz -C cache
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
- if: env.CURRENT_VERSION != env.LATEST_VERSION
name: "frps build and push"
working-directory: ./frp
run: |
mv cache/frp_${{env.LATEST_VERSION}}_linux_amd64/frps cache
docker buildx build -t mebtte/frps -f frps.Dockerfile --push .
- if: env.CURRENT_VERSION != env.LATEST_VERSION
name: "frpc build and push"
working-directory: ./frp
run: |
mv cache/frp_${{env.LATEST_VERSION}}_linux_amd64/frpc cache
docker buildx build -t mebtte/frpc -f frpc.Dockerfile --push .
- if: env.CURRENT_VERSION != env.LATEST_VERSION
name: "update docker readme of frps"
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: mebtte/frps
short-description: "A docker image for frps."
readme-filepath: "./frp/readme.md"
- if: env.CURRENT_VERSION != env.LATEST_VERSION
name: "update docker readme of frpc"
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: mebtte/frpc
short-description: "A docker image for frpc."
readme-filepath: "./frp/readme.md"