|
11 | 11 | jobs:
|
12 | 12 | update:
|
13 | 13 | runs-on: ubuntu-latest
|
14 |
| - |
| 14 | + outputs: |
| 15 | + updated: ${{ steps.deploy-file.outputs.deployment-status }} |
| 16 | + sha: ${{ steps.get-sha.outputs.sha }} |
15 | 17 | steps:
|
16 | 18 | - name: Get current time
|
17 | 19 | uses: srfrnk/current-time@master
|
18 | 20 | id: current-time
|
19 | 21 | with:
|
20 | 22 | format: "YYYY-MM-DD HH:mm"
|
21 |
| - |
22 | 23 | - name: Checkout
|
23 |
| - uses: actions/checkout@v3 |
24 |
| - |
| 24 | + uses: actions/checkout@v4 |
25 | 25 | - name: Update
|
26 | 26 | run: |
|
27 | 27 | bash update-files.sh
|
28 |
| -
|
29 | 28 | - name: Push
|
30 | 29 | uses: JamesIves/github-pages-deploy-action@v4
|
31 | 30 | id: deploy-file
|
|
35 | 34 | git-config-name: github-actions[bot]
|
36 | 35 | git-config-email: 41898282+github-actions[bot]@users.noreply.github.com
|
37 | 36 | commit-message: updated ${{ steps.current-time.outputs.formattedTime }} UTC
|
38 |
| - |
39 | 37 | - name: tagging-get-current-time
|
40 | 38 | if: ${{ steps.deploy-file.outputs.deployment-status == 'success' }}
|
41 | 39 | uses: srfrnk/current-time@master
|
|
50 | 48 | CUSTOM_TAG: ${{ steps.current-time-tagging.outputs.formattedTime }}
|
51 | 49 | DEFAULT_BRANCH: master
|
52 | 50 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
| 51 | + |
| 52 | + |
| 53 | + push_tag: |
| 54 | + runs-on: ubuntu-latest |
| 55 | + needs: [ update ] |
| 56 | + # 仅在有 Push 时 |
| 57 | + if: ${{ needs.update.outputs.updated == 'success' }} |
| 58 | + strategy: |
| 59 | + matrix: |
| 60 | + item: ['iana-etc', 'bind'] # TODO: 修改为 based by files.list |
| 61 | + steps: |
| 62 | + - name: Sleep to wait for GitHub process output |
| 63 | + run: | |
| 64 | + sleep 10s |
| 65 | + - name: checkout |
| 66 | + uses: actions/checkout@v4 |
| 67 | + with: |
| 68 | + fetch-depth: 0 |
| 69 | + ref: refs/heads/master |
| 70 | + |
| 71 | + - name: tagging-get-current-time |
| 72 | + uses: srfrnk/current-time@master |
| 73 | + id: current-time-tagging |
| 74 | + with: |
| 75 | + format: "YYYYMMDD" |
| 76 | + - name: Get current time |
| 77 | + uses: srfrnk/current-time@master |
| 78 | + id: current-time |
| 79 | + with: |
| 80 | + format: "YYYY-MM-DD HH:mm" |
| 81 | + - name: Push |
| 82 | + uses: JamesIves/github-pages-deploy-action@v4 |
| 83 | + id: deploy-file |
| 84 | + with: |
| 85 | + branch: ${{ matrix.item }} |
| 86 | + folder: ${{ matrix.item }} |
| 87 | + git-config-name: github-actions[bot] |
| 88 | + git-config-email: 41898282+github-actions[bot]@users.noreply.github.com |
| 89 | + commit-message: "chore(ci): updated ${{ matrix.item }} ${{ steps.current-time.outputs.formattedTime }} UTC" |
| 90 | + |
| 91 | + - name: Tagging |
| 92 | + if: ${{ steps.deploy-file.outputs.deployment-status == 'success' }} |
| 93 | + uses: anothrNick/github-tag-action@1.75.0 |
| 94 | + env: |
| 95 | + CUSTOM_TAG: ${{ matrix.item }}-${{ steps.current-time-tagging.outputs.formattedTime }} |
| 96 | + DEFAULT_BRANCH: ${{ matrix.item }} |
| 97 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 98 | + |
0 commit comments