diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index d03a44b..0e27a6f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -49,4 +49,30 @@ jobs: run: npm ci - name: Run linting - run: npm run lint \ No newline at end of file + run: npm run lint + + build: + name: build + needs: [test] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20.x' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Build frontend + run: npm run build + + - name: Upload build artifact + uses: actions/upload-artifact@v4 + with: + name: dist + path: dist/ + retention-days: 1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..aaa0c2b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,40 @@ +name: Release + +on: + release: + types: [created] + +permissions: + contents: write + +jobs: + build-and-upload: + name: Build and Upload Release Assets + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20.x' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Build frontend + run: npm run build + + - name: Zip dist directory + run: zip -r dist.zip dist + + - name: Upload dist as release asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ./dist.zip + asset_name: dist.zip + asset_content_type: application/zip \ No newline at end of file