代码拉取完成,页面将自动刷新
同步操作将从 test-instructor/yangfan 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
name: CI
on:
push:
branches:
- main
- dev
tags:
- '*'
env:
REGISTRY: yangfanz/
ALIYUN_REGISTRY: registry.cn-hangzhou.aliyuncs.com/yangfanz/
IMAGE_NAME_SERVER: server
IMAGE_NAME_TIMER: timer
IMAGE_NAME_MASTER: master
IMAGE_NAME_WORK: work
IMAGE_NAME_WEB: web
IMAGE_NAME_RUN: run
IMAGE_TAG: v1.${{ github.run_number }}
jobs:
server:
name: Building a server image
runs-on: ubuntu-latest
steps:
- name: Determine image_tag and image_suffix
id: determine
run: |
if [[ ${{ github.event_name }} == 'push' && ${{ github.ref }} =~ ^refs/tags/.* ]]; then
image_tag=$(echo "${{ github.ref }}" | sed -e 's|^refs/tags/||')
image_suffix=''
else
image_tag=${{ env.IMAGE_TAG }}
image_suffix='-debug'
fi
echo "::set-output name=image_tag::${image_tag}"
echo "::set-output name=image_suffix::${image_suffix}"
- uses: actions/checkout@v3
- name: Login to Docker Container Registry
uses: docker/login-action@v1
with:
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build and push Docker image
run: |
docker build -t server -f server/Dockerfile .
docker tag server ${{ env.REGISTRY }}${{ env.IMAGE_NAME_SERVER }}${{ steps.determine.outputs.image_suffix }}:${{ steps.determine.outputs.image_tag }}
docker push ${{ env.REGISTRY }}${{ env.IMAGE_NAME_SERVER }}${{ steps.determine.outputs.image_suffix }}:${{ steps.determine.outputs.image_tag }}
docker tag server ${{ env.REGISTRY }}${{ env.IMAGE_NAME_SERVER }}${{ steps.determine.outputs.image_suffix }}:latest
docker push ${{ env.REGISTRY }}${{ env.IMAGE_NAME_SERVER }}${{ steps.determine.outputs.image_suffix }}:latest
- name: Login to Aliyun Container Registry
uses: docker/login-action@v1
with:
registry: ${{ env.ALIYUN_REGISTRY }}${{ env.IMAGE_NAME_SERVER }}
username: ${{ secrets.ALIYUN_REGISTRY_USERNAME }}
password: ${{ secrets.ALIYUN_REGISTRY_PASSWORD }}
- name: Push to Aliyun Docker image
run: |
docker tag server ${{ env.ALIYUN_REGISTRY }}${{ env.IMAGE_NAME_SERVER }}${{ steps.determine.outputs.image_suffix }}:${{ steps.determine.outputs.image_tag }}
docker push ${{ env.ALIYUN_REGISTRY }}${{ env.IMAGE_NAME_SERVER }}${{ steps.determine.outputs.image_suffix }}:${{ steps.determine.outputs.image_tag }}
docker tag server ${{ env.ALIYUN_REGISTRY }}${{ env.IMAGE_NAME_SERVER }}${{ steps.determine.outputs.image_suffix }}:latest
docker push ${{ env.ALIYUN_REGISTRY }}${{ env.IMAGE_NAME_SERVER }}${{ steps.determine.outputs.image_suffix }}:latest
timer:
name: Building a timer image
runs-on: ubuntu-latest
steps:
- name: Determine image_tag and image_suffix
id: determine
run: |
if [[ ${{ github.event_name }} == 'push' && ${{ github.ref }} =~ ^refs/tags/.* ]]; then
image_tag=$(echo "${{ github.ref }}" | sed -e 's|^refs/tags/||')
image_suffix=''
else
image_tag=${{ env.IMAGE_TAG }}
image_suffix='-debug'
fi
echo "::set-output name=image_tag::${image_tag}"
echo "::set-output name=image_suffix::${image_suffix}"
- uses: actions/checkout@v3
- name: Login to Docker Container Registry
uses: docker/login-action@v1
with:
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build and push Docker image
run: |
docker build -t timer -f timer/Dockerfile .
docker tag timer ${{ env.REGISTRY }}${{ env.IMAGE_NAME_TIMER }}${{ steps.determine.outputs.image_suffix }}:${{ steps.determine.outputs.image_tag }}
docker push ${{ env.REGISTRY }}${{ env.IMAGE_NAME_TIMER }}${{ steps.determine.outputs.image_suffix }}:${{ steps.determine.outputs.image_tag }}
docker tag timer ${{ env.REGISTRY }}${{ env.IMAGE_NAME_TIMER }}${{ steps.determine.outputs.image_suffix }}:latest
docker push ${{ env.REGISTRY }}${{ env.IMAGE_NAME_TIMER }}${{ steps.determine.outputs.image_suffix }}:latest
- name: Login to Aliyun Container Registry
uses: docker/login-action@v1
with:
registry: ${{ env.ALIYUN_REGISTRY }}${{ env.IMAGE_NAME_TIMER }}
username: ${{ secrets.ALIYUN_REGISTRY_USERNAME }}
password: ${{ secrets.ALIYUN_REGISTRY_PASSWORD }}
- name: Push to Aliyun Docker image
run: |
docker tag timer ${{ env.ALIYUN_REGISTRY }}${{ env.IMAGE_NAME_TIMER }}${{ steps.determine.outputs.image_suffix }}:${{ steps.determine.outputs.image_tag }}
docker push ${{ env.ALIYUN_REGISTRY }}${{ env.IMAGE_NAME_TIMER }}${{ steps.determine.outputs.image_suffix }}:${{ steps.determine.outputs.image_tag }}
docker tag timer ${{ env.ALIYUN_REGISTRY }}${{ env.IMAGE_NAME_TIMER }}${{ steps.determine.outputs.image_suffix }}:latest
docker push ${{ env.ALIYUN_REGISTRY }}${{ env.IMAGE_NAME_TIMER }}${{ steps.determine.outputs.image_suffix }}:latest
master:
name: Building a master image
runs-on: ubuntu-latest
steps:
- name: Determine image_tag and image_suffix
id: determine
run: |
if [[ ${{ github.event_name }} == 'push' && ${{ github.ref }} =~ ^refs/tags/.* ]]; then
image_tag=$(echo "${{ github.ref }}" | sed -e 's|^refs/tags/||')
image_suffix=''
else
image_tag=${{ env.IMAGE_TAG }}
image_suffix='-debug'
fi
echo "::set-output name=image_tag::${image_tag}"
echo "::set-output name=image_suffix::${image_suffix}"
- uses: actions/checkout@v3
- name: Login to Docker Container Registry
uses: docker/login-action@v1
with:
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build and push Docker image
run: |
docker build -t master -f master/Dockerfile .
docker tag master ${{ env.REGISTRY }}${{ env.IMAGE_NAME_MASTER }}${{ steps.determine.outputs.image_suffix }}:${{ steps.determine.outputs.image_tag }}
docker push ${{ env.REGISTRY }}${{ env.IMAGE_NAME_MASTER }}${{ steps.determine.outputs.image_suffix }}:${{ steps.determine.outputs.image_tag }}
docker tag master ${{ env.REGISTRY }}${{ env.IMAGE_NAME_MASTER }}${{ steps.determine.outputs.image_suffix }}:latest
docker push ${{ env.REGISTRY }}${{ env.IMAGE_NAME_MASTER }}${{ steps.determine.outputs.image_suffix }}:latest
- name: Login to Aliyun Container Registry
uses: docker/login-action@v1
with:
registry: ${{ env.ALIYUN_REGISTRY }}${{ env.IMAGE_NAME_MASTER }}
username: ${{ secrets.ALIYUN_REGISTRY_USERNAME }}
password: ${{ secrets.ALIYUN_REGISTRY_PASSWORD }}
- name: Push to Aliyun Docker image
run: |
docker tag master ${{ env.ALIYUN_REGISTRY }}${{ env.IMAGE_NAME_MASTER }}${{ steps.determine.outputs.image_suffix }}:${{ steps.determine.outputs.image_tag }}
docker push ${{ env.ALIYUN_REGISTRY }}${{ env.IMAGE_NAME_MASTER }}${{ steps.determine.outputs.image_suffix }}:${{ steps.determine.outputs.image_tag }}
docker tag master ${{ env.ALIYUN_REGISTRY }}${{ env.IMAGE_NAME_MASTER }}${{ steps.determine.outputs.image_suffix }}:latest
docker push ${{ env.ALIYUN_REGISTRY }}${{ env.IMAGE_NAME_MASTER }}${{ steps.determine.outputs.image_suffix }}:latest
work:
name: Building a work image
runs-on: ubuntu-latest
steps:
- name: Determine image_tag and image_suffix
id: determine
run: |
if [[ ${{ github.event_name }} == 'push' && ${{ github.ref }} =~ ^refs/tags/.* ]]; then
image_tag=$(echo "${{ github.ref }}" | sed -e 's|^refs/tags/||')
image_suffix=''
else
image_tag=${{ env.IMAGE_TAG }}
image_suffix='-debug'
fi
echo "::set-output name=image_tag::${image_tag}"
echo "::set-output name=image_suffix::${image_suffix}"
- uses: actions/checkout@v3
- name: Login to Docker Container Registry
uses: docker/login-action@v1
with:
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build and push Docker image
run: |
docker build -t work -f work/Dockerfile .
docker tag work ${{ env.REGISTRY }}${{ env.IMAGE_NAME_WORK }}${{ steps.determine.outputs.image_suffix }}:${{ steps.determine.outputs.image_tag }}
docker push ${{ env.REGISTRY }}${{ env.IMAGE_NAME_WORK }}${{ steps.determine.outputs.image_suffix }}:${{ steps.determine.outputs.image_tag }}
docker tag work ${{ env.REGISTRY }}${{ env.IMAGE_NAME_WORK }}${{ steps.determine.outputs.image_suffix }}:latest
docker push ${{ env.REGISTRY }}${{ env.IMAGE_NAME_WORK }}${{ steps.determine.outputs.image_suffix }}:latest
- name: Login to Aliyun Container Registry
uses: docker/login-action@v1
with:
registry: ${{ env.ALIYUN_REGISTRY }}${{ env.IMAGE_NAME_WORK }}
username: ${{ secrets.ALIYUN_REGISTRY_USERNAME }}
password: ${{ secrets.ALIYUN_REGISTRY_PASSWORD }}
- name: Push to Aliyun Docker image
run: |
docker tag work ${{ env.ALIYUN_REGISTRY }}${{ env.IMAGE_NAME_WORK }}${{ steps.determine.outputs.image_suffix }}:${{ steps.determine.outputs.image_tag }}
docker push ${{ env.ALIYUN_REGISTRY }}${{ env.IMAGE_NAME_WORK }}${{ steps.determine.outputs.image_suffix }}:${{ steps.determine.outputs.image_tag }}
docker tag work ${{ env.ALIYUN_REGISTRY }}${{ env.IMAGE_NAME_WORK }}${{ steps.determine.outputs.image_suffix }}:latest
docker push ${{ env.ALIYUN_REGISTRY }}${{ env.IMAGE_NAME_WORK }}${{ steps.determine.outputs.image_suffix }}:latest
run:
name: Building a run image
runs-on: ubuntu-latest
steps:
- name: Determine image_tag and image_suffix
id: determine
run: |
if [[ ${{ github.event_name }} == 'push' && ${{ github.ref }} =~ ^refs/tags/.* ]]; then
image_tag=$(echo "${{ github.ref }}" | sed -e 's|^refs/tags/||')
image_suffix=''
else
image_tag=${{ env.IMAGE_TAG }}
image_suffix='-debug'
fi
echo "::set-output name=image_tag::${image_tag}"
echo "::set-output name=image_suffix::${image_suffix}"
- uses: actions/checkout@v3
- name: Login to Docker Container Registry
uses: docker/login-action@v1
with:
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build and push Docker image
run: |
docker build -t run -f run/Dockerfile .
docker tag run ${{ env.REGISTRY }}${{ env.IMAGE_NAME_RUN }}${{ steps.determine.outputs.image_suffix }}:${{ steps.determine.outputs.image_tag }}
docker push ${{ env.REGISTRY }}${{ env.IMAGE_NAME_RUN }}${{ steps.determine.outputs.image_suffix }}:${{ steps.determine.outputs.image_tag }}
docker tag run ${{ env.REGISTRY }}${{ env.IMAGE_NAME_RUN }}${{ steps.determine.outputs.image_suffix }}:latest
docker push ${{ env.REGISTRY }}${{ env.IMAGE_NAME_RUN }}${{ steps.determine.outputs.image_suffix }}:latest
- name: Login to Aliyun Container Registry
uses: docker/login-action@v1
with:
registry: ${{ env.ALIYUN_REGISTRY }}${{ env.IMAGE_NAME_RUN }}
username: ${{ secrets.ALIYUN_REGISTRY_USERNAME }}
password: ${{ secrets.ALIYUN_REGISTRY_PASSWORD }}
- name: Push to Aliyun Docker image
run: |
docker tag run ${{ env.ALIYUN_REGISTRY }}${{ env.IMAGE_NAME_RUN }}${{ steps.determine.outputs.image_suffix }}:${{ steps.determine.outputs.image_tag }}
docker push ${{ env.ALIYUN_REGISTRY }}${{ env.IMAGE_NAME_RUN }}${{ steps.determine.outputs.image_suffix }}:${{ steps.determine.outputs.image_tag }}
docker tag run ${{ env.ALIYUN_REGISTRY }}${{ env.IMAGE_NAME_RUN }}${{ steps.determine.outputs.image_suffix }}:latest
docker push ${{ env.ALIYUN_REGISTRY }}${{ env.IMAGE_NAME_RUN }}${{ steps.determine.outputs.image_suffix }}:latest
web:
name: Building a web image
runs-on: ubuntu-latest
steps:
- name: Determine image_tag and image_suffix
id: determine
run: |
if [[ ${{ github.event_name }} == 'push' && ${{ github.ref }} =~ ^refs/tags/.* ]]; then
image_tag=$(echo "${{ github.ref }}" | sed -e 's|^refs/tags/||')
image_suffix=''
else
image_tag=${{ env.IMAGE_TAG }}
image_suffix='-debug'
fi
echo "::set-output name=image_tag::${image_tag}"
echo "::set-output name=image_suffix::${image_suffix}"
- uses: actions/checkout@v3
- name: Login to Docker Container Registry
uses: docker/login-action@v1
with:
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Build and push Docker image
run: |
docker build -t web -f ./web/Dockerfile .
docker tag web ${{ env.REGISTRY }}${{ env.IMAGE_NAME_WEB }}${{ steps.determine.outputs.image_suffix }}:${{ steps.determine.outputs.image_tag }}
docker push ${{ env.REGISTRY }}${{ env.IMAGE_NAME_WEB }}${{ steps.determine.outputs.image_suffix }}:${{ steps.determine.outputs.image_tag }}
docker tag web ${{ env.REGISTRY }}${{ env.IMAGE_NAME_WEB }}${{ steps.determine.outputs.image_suffix }}:latest
docker push ${{ env.REGISTRY }}${{ env.IMAGE_NAME_WEB }}${{ steps.determine.outputs.image_suffix }}:latest
- name: Login to Aliyun Container Registry
uses: docker/login-action@v1
with:
registry: ${{ env.ALIYUN_REGISTRY }}${{ env.IMAGE_NAME_WEB }}
username: ${{ secrets.ALIYUN_REGISTRY_USERNAME }}
password: ${{ secrets.ALIYUN_REGISTRY_PASSWORD }}
- name: Push to Aliyun Docker image
run: |
docker tag web ${{ env.ALIYUN_REGISTRY }}${{ env.IMAGE_NAME_WEB }}${{ steps.determine.outputs.image_suffix }}:${{ steps.determine.outputs.image_tag }}
docker push ${{ env.ALIYUN_REGISTRY }}${{ env.IMAGE_NAME_WEB }}${{ steps.determine.outputs.image_suffix }}:${{ steps.determine.outputs.image_tag }}
docker tag web ${{ env.ALIYUN_REGISTRY }}${{ env.IMAGE_NAME_WEB }}${{ steps.determine.outputs.image_suffix }}:latest
docker push ${{ env.ALIYUN_REGISTRY }}${{ env.IMAGE_NAME_WEB }}${{ steps.determine.outputs.image_suffix }}:latest
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。