fix: fixed the generate readme file script #118
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Code Push | |
on: | |
- push | |
- pull_request | |
jobs: | |
common: | |
runs-on: ubuntu-latest | |
outputs: | |
dockerChange: ${{ steps.docker-changed-files.outputs.any_changed }} | |
qinglongChange: ${{ steps.qinglong-changed-files.outputs.any_changed }} | |
monkeyChange: ${{ steps.monkey-changed-files.outputs.any_changed }} | |
steps: | |
- uses: actions/checkout@v4 | |
- id: qinglong-changed-files | |
uses: tj-actions/changed-files@v45 | |
with: | |
files: | | |
.github/** | |
src/qinglong/** | |
etc/** | |
packages/** | |
.nvmrc | |
package*.json | |
tsconfig.json | |
- id: monkey-changed-files | |
uses: tj-actions/changed-files@v45 | |
with: | |
files: | | |
.github/** | |
src/monkey/** | |
etc/** | |
packages/** | |
.nvmrc | |
package*.json | |
tsconfig.json | |
- id: docker-changed-files | |
uses: tj-actions/changed-files@v45 | |
with: | |
files: | | |
.github/** | |
src/docker/** | |
code_check: | |
runs-on: ubuntu-latest | |
needs: | |
- common | |
if: needs.common.outputs.qinglongChange == 'true' || needs.common.outputs.monkeyChange == 'true' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: npm ci | |
- name: TS Type Check | |
run: npm run lint:type-check | |
- name: unit test | |
run: npm run test | |
- name: Build Scripts | |
run: npm run build | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: dist | |
path: dist | |
monkey-push: | |
runs-on: ubuntu-latest | |
needs: | |
- common | |
- code_check | |
if: needs.common.outputs.monkeyChange == 'true' && github.event_name == 'push' && github.ref_name == github.event.repository.default_branch | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: dist | |
path: dist | |
- name: Deploy Monkey scripts | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
folder: dist/monkey | |
branch: monkey | |
qinglong-push: | |
runs-on: ubuntu-latest | |
needs: | |
- common | |
- code_check | |
if: needs.common.outputs.qinglongChange == 'true' && github.event_name == 'push' && github.ref_name == github.event.repository.default_branch | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: dist | |
path: dist | |
- name: Deploy Qinglong scripts | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
folder: dist/qinglong | |
branch: qinglong | |
docker_check: | |
runs-on: ubuntu-latest | |
needs: | |
- common | |
if: needs.common.outputs.dockerChange == 'true' | |
steps: | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build cron-exec | |
uses: docker/build-push-action@v6 | |
with: | |
load: true | |
context: "{{defaultContext}}:./src/docker/cron-exec/" | |
tags: | | |
arylo/cron-exec:latest | |
arylo/cron-exec:alpine | |
arylo/cron-exec:alpine-3.9 | |
cache-from: type=registry,ref=arylo/cron-exec:github-action-buildcache | |
cache-to: type=inline | |
- name: Build restart-after-change | |
uses: docker/build-push-action@v6 | |
with: | |
load: true | |
context: "{{defaultContext}}:./src/docker/restart-after-change/" | |
tags: | | |
arylo/restart-after-change:latest | |
arylo/restart-after-change:alpine | |
arylo/restart-after-change:alpine-3.9 | |
cache-from: type=registry,ref=arylo/restart-after-change:github-action-buildcache | |
cache-to: type=inline | |
docker_push: | |
runs-on: ubuntu-latest | |
needs: | |
- common | |
- docker_check | |
if: needs.common.outputs.dockerChange == 'true' && github.event_name == 'push' && github.ref_name == github.event.repository.default_branch | |
steps: | |
- name: Login to Docker Hub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ vars.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Build cron-exec | |
uses: docker/build-push-action@v6 | |
with: | |
push: true | |
load: true | |
context: "{{defaultContext}}:./src/docker/cron-exec/" | |
tags: | | |
arylo/cron-exec:latest | |
arylo/cron-exec:alpine | |
cache-from: type=registry,ref=arylo/cron-exec:github-action-buildcache | |
cache-to: type=registry,ref=arylo/cron-exec:github-action-buildcache,mode=max | |
- name: Build restart-after-change | |
uses: docker/build-push-action@v6 | |
with: | |
push: true | |
load: true | |
context: "{{defaultContext}}:./src/docker/restart-after-change/" | |
tags: | | |
arylo/restart-after-change:latest | |
arylo/restart-after-change:alpine | |
cache-from: type=registry,ref=arylo/restart-after-change:github-action-buildcache | |
cache-to: type=registry,ref=arylo/restart-after-change:github-action-buildcache,mode=max | |
readme-push: | |
runs-on: ubuntu-latest | |
needs: | |
- common | |
- code_check | |
if: github.event_name == 'push' && github.ref_name == github.event.repository.default_branch | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: npm ci | |
- name: Generate Readme files | |
run: npx ts-node ./etc/build/readme.ts | |
- name: Deploy Readme files | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
folder: . | |
branch: ${{ github.event.repository.default_branch }} | |
commit-message: 'chore: update README.md' |