fix for small screen #30
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will push to surge.sh | |
# | |
# Credits: | |
# https://github.com/yavisht/deploy-via-surge.sh-github-action-template | |
# | |
# Once you have generated the token, you need to add them as a secret in your | |
# GitHub repository: | |
# - SURGE_TOKEN: your Surge API token | |
# | |
# See https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets#creating-encrypted-secrets | |
# for more information about GitHub secrets. | |
name: publish | |
on: | |
push: | |
branches: [main] | |
# pull_request: | |
# branches: [main] | |
jobs: | |
# build: | |
# name: Build | |
# if: github.event_name == 'pull_request' | |
# runs-on: ubuntu-latest | |
# strategy: | |
# matrix: | |
# node-version: [18] | |
# steps: | |
# - name: Checkout | |
# uses: actions/checkout@v3 | |
# - uses: actions/setup-node@v3 | |
# with: | |
# node-version: ${{ matrix.node-version }} | |
# cache: yarn | |
# - run: yarn | |
# - name: Install textlint | |
# run: 'yarn add -D textlint textlint-rule-common-misspellings textlint-rule-spellchecker' | |
# - name: Run textlint | |
# run: npx textlint -f checkstyle "posts/**/*.md" >> .textlint.log | |
# - name: Run Prettier | |
# run: yarn run prettier:check | |
# - name: Run Embedme | |
# run: yarn run embedme:check | |
publish: | |
# Add "id-token" with the intended permissions. | |
# This is to enable publishing to GitHub pages. | |
permissions: | |
id-token: write | |
pages: write | |
name: publish | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
cache: 'npm' | |
- name: Cache node modules | |
id: npm-cache | |
uses: actions/cache@v4 | |
env: | |
cache-name: cache-node-modules | |
with: | |
# npm cache files are stored in `~/.npm` on Linux/macOS | |
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: List the state of node modules | |
continue-on-error: true | |
run: npm list | |
- name: Install Dependencies | |
if: ${{ steps.npm-cache.outputs.cache-hit != 'true' }} | |
run: npm ci | |
- name: Build for Production | |
# name: Build and Deploy to Surge | |
run: npm run build | |
# - name: Deploy to Surge.sh | |
# run: npx surge ./build ${{ secrets.SURGE_DOMAIN }} --token ${{ secrets.SURGE_TOKEN }} | |
- name: Setup Pages | |
uses: actions/configure-pages@v4 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
# Upload build repository | |
path: './build' | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |