Skip to content

Generate and push image #17

Generate and push image

Generate and push image #17

Workflow file for this run

name: Generate and push image
on:
workflow_dispatch:
push:
paths:
- 'frp-latest-version.txt'
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
# This is used to complete the identity challenge
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v2
- name: login docker hub
uses: docker/login-action@v2
with:
registry: docker.io
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: login ghcr
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: download source file
run: |
curl -s https://api.github.com/repos/fatedier/frp/releases/latest | grep "browser_download_url.*_linux_amd64.tar.gz" | cut -d '"' -f 4 | wget -qi - && tar -xzf frp_*
cp frp_*/frps ./frps/
cp frp_*/frpc ./frpc/
- name: build and push the image
run: |
VERSION=$(<frp-latest-version.txt)
docker build ./frps -t zen8841/frpc:$VERSION
docker build ./frpc -t zen8841/frpc:$VERSION
docker image tag zen8841/frps:$VERSION zen8841/frps:latest
docker image tag zen8841/frpc:$VERSION zen8841/frpc:latest
docker image tag zen8841/frps:$VERSION ghcr.io/zen8841/frps:$VERSION
docker image tag zen8841/frpc:$VERSION ghcr.io/zen8841/frpc:$VERSION
docker image tag zen8841/frps:$VERSION ghcr.io/zen8841/frps:latest
docker image tag zen8841/frps:$VERSION ghcr.io/zen8841/frps:latest
docker push --all-tags zen8841/frps
docker push --all-tags zen8841/frpc
docker push --all-tags ghcr.io/zen8841/frps
docker push --all-tags ghcr.io/zen8841/frpc