name: Gitea Action for docker build runtime run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀 on: push: branches: [master] paths: - 'requirements.txt' - 'RuntimeDockerfile' jobs: build-runtime: runs-on: ubuntu-latest steps: - run: echo "This job is now running on a ${{ runner.os }} server hosted by Gitea!" - name: Check out repository code uses: https://gitea.com/actions/checkout@v4 - name: Login to hub.airpig.cn uses: https://gitea.com/docker/login-action@v3 with: registry: hub.airpig.cn username: admin password: Chenweijia113! - run: | var=${{ gitea.repository }} repo=${var##*/}"-runtime" echo $repo url="https://hub.airpig.cn/api/v2.0/projects/library/repositories/${repo}/artifacts?page=1&page_size=10&with_tag=true&with_label=false&with_scan_overview=false&with_signature=false&with_immutable_status=false&with_accessory=false" version=$(curl -X 'GET' $url \ -H 'accept: application/json' \ -H 'X-Accept-Vulnerabilities: application/vnd.security.vulnerability.report; version=1.1, application/vnd.scanner.adapter.vuln.report.harbor+json; version=1.0' \ -u 'admin:Chenweijia!' | jq '.[0].tags[0].name') if [ ! $version ]; then new_version=v1.0.0 else new_version=$(echo $version | sed 's/\"//g' | awk -F. '{$NF = $NF + 1;} 1' OFS=.) fi docker build -t hub.airpig.cn/library/$repo:$new_version -f RuntimeDockerfile . docker push hub.airpig.cn/library/$repo:$new_version docker rmi hub.airpig.cn/library/$repo:$new_version - run: echo "This job's status is ${{ job.status }}."