Skip to content

deploy

deploy #35

Workflow file for this run

name: Deploy
on:
workflow_dispatch:
repository_dispatch:
types: [deploy]
push:
branches:
- master
- main
paths:
- '.github/workflows/deploy.yml'
concurrency:
group: deploy-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: πŸ›Ž Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: πŸ— Setup node env
uses: actions/setup-node@v4
with:
node-version: 16
- name: πŸ›  Get yarn cache directory path
id: yarn-cache-dir-path
run: |
# shellcheck disable=SC2086
echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: πŸ“¦ Cache node_modules
uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: πŸ‘¨πŸ»β€πŸ’» Install dependencies
run: yarn
- name: πŸ—οΈ Nuxt build
run: yarn build
env:
MICROCMS_API_URL: ${{ secrets.MICROCMS_API_URL }}
MICROCMS_API_KEY: ${{ secrets.MICROCMS_API_KEY }}
- name: 🏭 Nuxt generate
run: yarn generate
env:
MICROCMS_API_URL: ${{ secrets.MICROCMS_API_URL }}
MICROCMS_API_KEY: ${{ secrets.MICROCMS_API_KEY }}
- name: πŸ†™ Upload Pages-artifact
uses: actions/upload-pages-artifact@v3
with:
path: dist
deploy:
runs-on: ubuntu-latest
needs: build
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: πŸš€ Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4