Create frps_linux_install.sh #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "docker build release" | |
on: | |
push: | |
workflow_dispatch: | |
env: | |
PROJECT: frpc | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Set tag | |
id: tag | |
run: | | |
if [[ -n $(cat Dockerfile | awk '{if($1~"ENV" && $2=="VERSION")print $3}') ]]; then | |
VERSION=$(cat Dockerfile | awk '{if($1~"ENV" && $2=="VERSION")print $3}') | |
echo "tag=$VERSION" >> $GITHUB_ENV | |
else | |
echo "tag=$(date +%Y)-$(date +%m)-$(date +%d)" >> $GITHUB_ENV | |
fi | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v1 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v1 | |
- name: Login Docker Hub | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Build and push to docker hub | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64,linux/arm/v7 | |
push: true | |
tags: | | |
${{ secrets.DOCKER_USERNAME }}/${{ env.PROJECT }}:latest | |
${{ secrets.DOCKER_USERNAME }}/${{ env.PROJECT }}:${{ env.tag }} | |
- name: Sync README.md to Docker Hub | |
uses: ms-jpq/sync-dockerhub-readme@v1 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
repository: ${{ secrets.DOCKER_USERNAME }}/${{ env.PROJECT }} | |
readme: "./README.md" | |
- name: Login harbor | |
uses: docker/login-action@v1 | |
with: | |
registry: ${{ secrets.HARBOR_REGISTRY }} | |
username: ${{ secrets.HARBOR_USERNAME }} | |
password: ${{ secrets.HARBOR_PASSWORD }} | |
- name: Build and push to harbor | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
platforms: linux/amd64,linux/arm64,linux/arm/v7 | |
push: true | |
tags: | | |
${{ secrets.HARBOR_REGISTRY }}/${{ secrets.HARBOR_USERNAME }}/${{ env.PROJECT }}:latest | |
${{ secrets.HARBOR_REGISTRY }}/${{ secrets.HARBOR_USERNAME }}/${{ env.PROJECT }}:${{ env.tag }} |