From 9565736ace5badf50d3789d6461c8fc2982370ea Mon Sep 17 00:00:00 2001 From: josephlim90 Date: Wed, 20 Jul 2022 17:01:32 +0800 Subject: [PATCH 1/4] add github actions --- workflows/build.yml | 69 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 workflows/build.yml diff --git a/workflows/build.yml b/workflows/build.yml new file mode 100644 index 000000000..e836bc663 --- /dev/null +++ b/workflows/build.yml @@ -0,0 +1,69 @@ +name: Bitcoin order App +on: + push: + branches: + - githubcicd +jobs: + ci: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [16.x] + + steps: + - uses: actions/checkout@v2 + - uses: browser-actions/setup-chrome@latest + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + + - name: Cache node modules + id: cache-nodemodules + uses: actions/cache@v2 + env: + cache-name: cache-node-modules + with: + # caching node_modules + path: node_modules + key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-build-${{ env.cache-name }}- + ${{ runner.os }}-build- + ${{ runner.os }}- + - name: Install Dependencies + if: steps.cache-nodemodules.outputs.cache-hit != 'true' + run: | + npm ci --force + - name: Build + run: | + npm run build --force + - name: Lint + run: | + npm run lint + - name: Update types to latest + run: | + npm install --save-dev @types/node@latest --force + - name: Test + run: | + npm run test + - name: Conventional Changelog Action + id: changelog + uses: TriPSs/conventional-changelog-action@v3 + with: + github-token: ${{ secrets.WORKSHOP6_GITHUB_TOKEN }} + output-file: "false" + + - name: Create Release + uses: actions/create-release@v1 + if: ${{ steps.changelog.outputs.skipped == 'false' }} + env: + GITHUB_TOKEN: ${{ secrets.WORKSHOP6_GITHUB_TOKEN }} + with: + tag_name: ${{ steps.changelog.outputs.tag }} + release_name: ${{ steps.changelog.outputs.tag }} + body: ${{ steps.changelog.outputs.clean_changelog }} + - name: Deploy + run: | + npm run deploy \ No newline at end of file From 22af820a2a771927bd07abefed1623136c8196ca Mon Sep 17 00:00:00 2001 From: josephlim90 Date: Wed, 20 Jul 2022 17:07:49 +0800 Subject: [PATCH 2/4] add github actions 2 --- {workflows => .github/workflows}/build.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {workflows => .github/workflows}/build.yml (100%) diff --git a/workflows/build.yml b/.github/workflows/build.yml similarity index 100% rename from workflows/build.yml rename to .github/workflows/build.yml From 4a0904ba5b6a31d9cffc461683ccbd0d94f0e246 Mon Sep 17 00:00:00 2001 From: josephlim90 Date: Wed, 20 Jul 2022 17:19:58 +0800 Subject: [PATCH 3/4] add github actions 3 --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e836bc663..a2f166470 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -63,7 +63,8 @@ jobs: with: tag_name: ${{ steps.changelog.outputs.tag }} release_name: ${{ steps.changelog.outputs.tag }} - body: ${{ steps.changelog.outputs.clean_changelog }} + body: ${{ steps.changelog.outputs.clean_changelog } + } - name: Deploy run: | npm run deploy \ No newline at end of file From 66b41077ecb8ee0093522cf10ca777d92f2eb487 Mon Sep 17 00:00:00 2001 From: josephlim90 Date: Wed, 20 Jul 2022 17:21:43 +0800 Subject: [PATCH 4/4] add github actions 4 --- .github/workflows/build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a2f166470..e836bc663 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -63,8 +63,7 @@ jobs: with: tag_name: ${{ steps.changelog.outputs.tag }} release_name: ${{ steps.changelog.outputs.tag }} - body: ${{ steps.changelog.outputs.clean_changelog } - } + body: ${{ steps.changelog.outputs.clean_changelog }} - name: Deploy run: | npm run deploy \ No newline at end of file