diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml index 089a81a..137204a 100644 --- a/.gitea/workflows/ci.yaml +++ b/.gitea/workflows/ci.yaml @@ -3,11 +3,11 @@ run-name: ${{ github.actor }} Gitea Actions 🚀🚀🚀 on: push: # Sequence of patterns matched against refs/heads - # branches: - # - main + branches: + - main # Sequence of patterns matched against refs/tags tags: - - v* + - v* env: # DOCKER_REGISTRY: docker.io @@ -23,67 +23,67 @@ jobs: container: image: ghcr.m.daocloud.io/catthehacker/ubuntu:act-latest steps: - # - name: 环境检测 - # run: | - # which node - # node --version - # which npm - # npm --version - # which docker - # docker info - # echo ${{ github.token }} - # echo ${{ env.GITOPS_URL }} + # - name: 环境检测 + # run: | + # which node + # node --version + # which npm + # npm --version + # which docker + # docker info + # echo ${{ github.token }} + # echo ${{ env.GITOPS_URL }} - - name: 拉取代码 - uses: https://${{ env.DOMAIN }}/actions/checkout@v4 + - name: 拉取代码 + uses: https://${{ env.DOMAIN }}/actions/checkout@v4 - # Docker配置多平台环境 - # - name: Docker配置多平台环境 - # uses: https://${{ env.DOMAIN }}/actions/setup-buildx-action@v3 + # Docker配置多平台环境 + # - name: Docker配置多平台环境 + # uses: https://${{ env.DOMAIN }}/actions/setup-buildx-action@v3 - # - name: 获取当前时间 - # id: date - # run: echo "::set-output name=date::$(date +'%Y%m%d%H%M%S')" + # - name: 获取当前时间 + # id: date + # run: echo "::set-output name=date::$(date +'%Y%m%d%H%M%S')" - # - name: 构建 & 推送镜像 - # uses: https://${{ env.DOMAIN }}/actions/docker-build-push@v6 - # with: - # image: ${{ gitea.repository }} - # tags: ${{ github.sha }} - # registry: softyouling-docker.pkg.coding.net - # enableBuildKit: true - # # multiPlatform: true - # # platform: linux/amd64,linux/arm64,linux/arm/v7 - # dockerfile: Dockerfile - # username: ${{ secrets.DOCKER_USERNAME }} - # password: ${{ secrets.DOCKER_PASSWORD }} - - name: 🐬镜像构建推送 - uses: https://${{ env.DOMAIN }}/actions/docker-build-push@main - with: - image: ${{ gitea.repository }} - tags: ${{ gitea.sha }} - registry: ${{ env.DOMAIN }} - # enableBuildKit: true - provenance: false - dockerfile: Dockerfile - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} + # - name: 构建 & 推送镜像 + # uses: https://${{ env.DOMAIN }}/actions/docker-build-push@v6 + # with: + # image: ${{ gitea.repository }} + # tags: ${{ github.sha }} + # registry: softyouling-docker.pkg.coding.net + # enableBuildKit: true + # # multiPlatform: true + # # platform: linux/amd64,linux/arm64,linux/arm/v7 + # dockerfile: Dockerfile + # username: ${{ secrets.DOCKER_USERNAME }} + # password: ${{ secrets.DOCKER_PASSWORD }} + - name: 🐬镜像构建推送 + uses: https://${{ env.DOMAIN }}/actions/docker-build-push@main + with: + image: ${{ gitea.repository }} + tags: ${{ gitea.sha }} + registry: ${{ env.DOMAIN }} + # enableBuildKit: true + provenance: false + dockerfile: Dockerfile + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} gtiops: runs-on: ubuntu-latest if: ${{ success() }} needs: [build] steps: - - name: 🐬更新应用镜像 - uses: http://gitea.lntu.edu.cn/actions/gitops@main - with: - email: "gitops@lntu.edu.cn" - name: "千里走单骑" - value: ${{ gitea.repository }} - tag: ${{ github.sha }} - url: ${{ env.DOMAIN }}/${{ secrets.GITOPS_REPO}} - filename: ${{ secrets.FILE_NAME }} - token: ${{ secrets.GITOPS_TOKEN }} + - name: 🐬更新应用镜像 + uses: http://gitea.lntu.edu.cn/actions/gitops@main + with: + email: "gitops@lntu.edu.cn" + name: "千里走单骑" + value: ${{ gitea.repository }} + tag: ${{ github.sha }} + url: ${{ env.DOMAIN }}/${{ secrets.GITOPS_REPO}} + filename: ${{ secrets.FILE_NAME }} + token: ${{ secrets.GITOPS_TOKEN }} 微信通知: runs-on: ubuntu-latest @@ -91,17 +91,13 @@ jobs: needs: [build, gtiops] steps: - # 发送通知 - - name: 微信通知 - uses: - https://${{ env.DOMAIN }}/actions/action-wechat-work@master - # 若没有配置机器人WebHook则跳过 - if: ${{ secrets.WECHAT_WORK_BOT_WEBHOOK != '' }} - env: - WECHAT_WORK_BOT_WEBHOOK: ${{ secrets.WECHAT_WORK_BOT_WEBHOOK }} - with: - msgtype: markdown - content: "✅ 应用版本更新成功\n - > 🐬 镜像:\n - > softyouling-docker.pkg.coding.net/code/demo/demo:${{ github.sha }}\n - > 🍏 就能帮你到这了" + # 发送通知 + - name: 微信通知 + uses: https://${{ env.DOMAIN }}/actions/action-wechat-work@master + # 若没有配置机器人WebHook则跳过 + if: ${{ secrets.WECHAT_WORK_BOT_WEBHOOK != '' }} + env: + WECHAT_WORK_BOT_WEBHOOK: ${{ secrets.WECHAT_WORK_BOT_WEBHOOK }} + with: + msgtype: markdown + content: "✅ 应用版本更新成功\n > 🐬 镜像:\n > softyouling-docker.pkg.coding.net/code/demo/demo:${{ github.sha }}\n > 🍏 就能帮你到这了"