Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change deploy workflow #285

Merged
merged 1 commit into from Apr 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
48 changes: 12 additions & 36 deletions .github/workflows/deploy.yml
Expand Up @@ -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