Skip to content

Commit

Permalink
Working (#12)
Browse files Browse the repository at this point in the history
* Added info on #1
* Issue #5 work
* Resolves #8
* Fixes #10. 
* Added tests. 
* Added automatic deployment
  • Loading branch information
FoxUSA committed May 19, 2022
1 parent 8304ec1 commit 541b04e
Show file tree
Hide file tree
Showing 23 changed files with 29,062 additions and 22,211 deletions.
5 changes: 3 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ module.exports = {
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-return-assign': 'off'
'no-return-assign': 'off',
'vue/multi-word-component-names': 'off'
},
parserOptions: {
parser: 'babel-eslint'
'ecmaVersion': 2020
}
}
33 changes: 0 additions & 33 deletions .github/workflows/auto-test.yml

This file was deleted.

72 changes: 72 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Build

on:
pull_request:
workflow_call:

jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-latest]
node-version: [17.x]

steps:
- run: git config --global core.autocrlf false
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'

- name: Install StoreDown dependencies
run: npm ci

- name: Run linter
run: npm run lint

- name: Run e2e tests
id: tests
run: npx vue-cli-service test:e2e --headless

- name: Get test screenshots
if: failure() && steps.tests.outcome == 'failure'
uses: actions/upload-artifact@v3
with:
name: testScreenshots
path: |
tests/e2e/screenshots
- name: Get test videos
if: failure() && steps.tests.outcome == 'failure'
uses: actions/upload-artifact@v3
with:
name: testVideo
path: |
tests/e2e/videos
- name: Build StoreDown
run: npm run build

- name: Build artifact
uses: actions/upload-artifact@v3
with:
name: dist
path: dist

- name: Upload release files
uses: actions/upload-artifact@v3
with:
name: release
path: |
package.json
Dockerfile
62 changes: 62 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Release

on:
push:
branches:
- master

jobs:
build:
uses: ./.github/workflows/build.yml

release:
runs-on: ubuntu-latest
needs: build
steps:
- name: Retrieve build
uses: actions/download-artifact@v3
with:
name: dist
path: ./dist
- name: Retrieve release files
uses: actions/download-artifact@v3
with:
name: release
path: ./
- name: Install jq
run: sudo apt-get install -y jq
#Based on https://stackoverflow.com/questions/58177786/get-the-current-pushed-tag-in-github-actions
- name: Get version
run: echo "RELEASE_VERSION=$(jq -r .version ./package.json)" >> $GITHUB_ENV
- name: Test
run: |
echo $RELEASE_VERSION
ls -lt dist
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: foxusa/storedown:latest,foxusa/storedown:${{ env.RELEASE_VERSION }}

- name: Zip up release
run: cd dist && zip -r v${{ env.RELEASE_VERSION }}.zip .

- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
name: StoreDown v${{ env.RELEASE_VERSION }}
tag_name: v${{ env.RELEASE_VERSION }}
files: |
dist/v${{ env.RELEASE_VERSION }}.zip
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ node_modules

/tests/e2e/reports/
selenium-debug.log
screenshots
videos

# local env files
.env.local
Expand Down
6 changes: 6 additions & 0 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ npm run test:e2e
npm run test:unit
```

### Zip up the build folder
```
npm run dist
```


### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).

Expand Down
Loading

0 comments on commit 541b04e

Please sign in to comment.