From 82e7768f236e2a1f6c96ab71e37a684bcc667172 Mon Sep 17 00:00:00 2001 From: Haralan Dobrev Date: Wed, 17 Mar 2021 14:04:24 +0200 Subject: [PATCH] Release to production on new tags --- .github/workflows/release.yml | 42 +++++++++++++++++++++++++++++++++++ package.json | 3 ++- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..0a849b6 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,42 @@ +name: Deployment to Production + +on: + push: + tags: + - '**' +jobs: + build: + name: Deploy + runs-on: ubuntu-latest + steps: + - name: Check out repo + uses: actions/checkout@v1 + + - name: Set up node + uses: actions/setup-node@v2 + with: + node-version: '15' + + - name: Cache dependencies + uses: actions/cache@v2 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + + - name: Clean install of dependencies + run: npm ci + + - name: Build + run: npm run-script build-production + + - name: Minio Deploy + uses: hkdobrev/minio-deploy-action@v1 + with: + endpoint: ${{ secrets.MINIO_PRODUCTION_ENDPOINT }} + access_key: ${{ secrets.MINIO_PRODUCTION_ACCESS_KEY }} + secret_key: ${{ secrets.MINIO_PRODUCTION_SECRET_KEY }} + bucket: ${{ secrets.MINIO_PRODUCTION_BUCKET }} + source_dir: 'public' + target_dir: '/' diff --git a/package.json b/package.json index 6c58a9c..782e3df 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,8 @@ "main": "index.js", "scripts": { "build": "webpack --config webpack/build.config.js", - "serve": "webpack serve --env API_HOST=https://api.tibroish.bg --config webpack/serve.config.js" + "build-production": "webpack --config webpack/build.config.js --env API_HOST=https://api.tibroish.bg", + "serve": "webpack serve --config webpack/serve.config.js --env API_HOST=https://api.tibroish.bg" }, "author": "", "dependencies": {