diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 832a771c..5bdd207b 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -5,44 +5,20 @@ on: branches: [master] jobs: - build: + build-and-deploy: + concurrency: ci-${{ github.ref }} runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [14.x] - steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v2 - with: - node-version: ${{ matrix.node-version }} - - name: Cache Node.js modules - uses: actions/cache@v2 - id: yarn-cache - with: - path: '**/node_modules' - key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} - - name: Install dependencies - if: steps.yarn-cache.outputs.cache-hit != 'true' - run: yarn --frozen-lockfile - - name: Build - run: yarn build - - name: Init new repo in dist folder and commit generated files + - name: Checkout 🛎️ + uses: actions/checkout@v3 + + - name: Install and Build 🔧 run: | - cd dist - git config --global --add safe.directory /github/workspace/dist - git init - git add -A - git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - git commit -m 'deploy' + yarn + yarn build - - name: Force push to destination branch - uses: ad-m/github-push-action@v0.5.0 + - name: Deploy 🚀 + uses: JamesIves/github-pages-deploy-action@v4.3.0 with: - github_token: ${{ secrets.GITHUB_TOKEN }} - branch: gh-pages - force: true - directory: ./dist + branch: gh-pages + folder: dist \ No newline at end of file