diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..ec607f5 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,29 @@ +name: Build Application + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Install dependencies + run: yarn install + + - name: Generate code + run: make gen + + - name: Build application + run: make build diff --git a/.github/workflows/image-build.yml b/.github/workflows/image-build.yml new file mode 100644 index 0000000..1fec96f --- /dev/null +++ b/.github/workflows/image-build.yml @@ -0,0 +1,29 @@ +name: Build Docker Image + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + image-build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Install dependencies + run: yarn install + + - name: Generate code + run: make gen + + - name: Build Docker image + run: make image-build diff --git a/makefile b/makefile index 21ffaec..a3f2062 100644 --- a/makefile +++ b/makefile @@ -1,8 +1,11 @@ -GIT_VERSION = `git rev-parse --short main` +GIT_VERSION = `git rev-parse --short HEAD` run: yarn dev +build: + yarn build + gen: yarn run openapi-ts -i http://dm2.sao.ru:81/api/openapi.json -o ./src/clients/backend