diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 88bf01e..442f66c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,41 +1,41 @@ -# This is a basic workflow to help you get started with Actions +name: Deploy PR previews -name: CI - -# Controls when the action will run. Triggers the workflow on push or pull request -# events but only for the master branch on: - push: - branches: [ master ] - paths-ignore: - - 'README.md' pull_request: - branches: [ master ] + types: + - opened + - reopened + - synchronize + - closed + + +concurrency: preview-${{ github.ref }} jobs: - # This job is an example of continious integration - # It runs test and lints the code - test: + deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: node-version: 16 - - name: Cache multiple paths + - name: Cache + id: cache uses: actions/cache@v3 with: path: | node_modules - ~/.cache/Cypress - yarn-cache - key: ${{ runner.os }}-v1-${{ hashFiles('yarn.lock') }} - - name: install npm dependencies - run: yarn config set cache-folder `pwd`/yarn-cache && yarn install --frozen-lockfile - - name: build - run: yarn build:test - - name: test-cypress - run: yarn test:cypress:run - - name: eslint - run: yarn run lint - + key: ${{ runner.os }}-v32-${{ hashFiles('yarn.lock') }} + - name: install deps + if: steps.cache.outputs.cache-hit != 'true' + run: yarn install --frozen-lockfile + - name: BUild + env: + VITE_BUILD_ENV: development + run: yarn build + - name: Deploy preview1 + uses: rossjrw/pr-preview-action@v1 + with: + source-dir: ./dist/ + deploy-repository: akoidan/vue3-vite-pr-test + token: ${{ secrets.PR_PAT_TOKEN }} diff --git a/src/vue/app.vue b/src/vue/app.vue index eb6def8..9be7585 100644 --- a/src/vue/app.vue +++ b/src/vue/app.vue @@ -20,6 +20,6 @@ export default class App extends Vue {