|
| 1 | +name: master test tag release workflow |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + paths-ignore: |
| 6 | + - '**/*.md' |
| 7 | + - '**/*.yml' |
| 8 | + tags: |
| 9 | + - 'test-*' |
| 10 | + workflow_dispatch: |
| 11 | +jobs: |
| 12 | + build-reactapp: |
| 13 | + runs-on: ubuntu-latest |
| 14 | + defaults: |
| 15 | + run: |
| 16 | + working-directory: src/AgileConfig.Server.UI/react-ui-antd |
| 17 | + strategy: |
| 18 | + matrix: |
| 19 | + node-version: [16.x] |
| 20 | + |
| 21 | + steps: |
| 22 | + - uses: actions/checkout@v2 |
| 23 | + - name: Use Node.js ${{ matrix.node-version }} |
| 24 | + uses: actions/setup-node@v1 |
| 25 | + with: |
| 26 | + node-version: ${{ matrix.node-version }} |
| 27 | + |
| 28 | + - run: npm install |
| 29 | + - run: npm run build |
| 30 | + |
| 31 | + - uses: actions/upload-artifact@v4 |
| 32 | + with: |
| 33 | + name: agileconfig-ui |
| 34 | + path: src/AgileConfig.Server.UI/react-ui-antd/dist/ |
| 35 | + |
| 36 | + build-dotnet-push-to-hub: |
| 37 | + needs: build-reactapp |
| 38 | + runs-on: ubuntu-latest |
| 39 | + |
| 40 | + steps: |
| 41 | + - uses: actions/checkout@v2 |
| 42 | + - name: Setup .NET Core |
| 43 | + uses: actions/setup-dotnet@v1 |
| 44 | + with: |
| 45 | + dotnet-version: 8.0.* |
| 46 | + |
| 47 | + - name: Install dependencies |
| 48 | + run: dotnet restore |
| 49 | + - name: Build |
| 50 | + run: dotnet build --configuration Release --no-restore |
| 51 | + |
| 52 | + - uses: actions/download-artifact@v4 |
| 53 | + with: |
| 54 | + name: agileconfig-ui |
| 55 | + path: src/AgileConfig.Server.Apisite/wwwroot/ui |
| 56 | + |
| 57 | + - name: Push to Docker Hub |
| 58 | + uses: docker/build-push-action@v1 |
| 59 | + with: |
| 60 | + username: ${{ secrets.DOCKER_HUB_NAME }} |
| 61 | + password: ${{ secrets.DOCKER_HUB_PASSWORD }} |
| 62 | + repository: kklldog/agile_config |
| 63 | + tags: test |
| 64 | + |
| 65 | + - name: Login to ACR and push |
| 66 | + uses: aliyun/acr-login@v1 |
| 67 | + with: |
| 68 | + login-server: https://registry.cn-shanghai.aliyuncs.com |
| 69 | + username: "${{ secrets.ALI_REGISTRY_USERNAME }}" |
| 70 | + password: "${{ secrets.ALI_REGISTRY_PASSWORD }}" |
| 71 | + |
| 72 | + - name: Build and push image |
| 73 | + env: |
| 74 | + IMAGE_TAG: test |
| 75 | + run: | |
| 76 | + docker build -t registry.cn-shanghai.aliyuncs.com/kklldog/agile_config:$IMAGE_TAG . |
| 77 | + docker push registry.cn-shanghai.aliyuncs.com/kklldog/agile_config:$IMAGE_TAG |
0 commit comments