feat: create buy_macbook.md #19
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 is a basic workflow to help you get started with Actions | |
name: CD | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow on push or pull request events but only for the "main" branch | |
push: | |
branches: [ "main" ] | |
# sometimes bot trigger CD without Permission | |
# pull_request: | |
# branches: [ "main" ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
name: A job to deploy blog. | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v1 | |
with: | |
submodules: true # Checkout private submodules(themes or something else). | |
# Caching dependencies to speed up workflows. (GitHub will remove any cache entries that have not been accessed in over 7 days.) | |
- name: Cache node modules | |
uses: actions/cache@v1 | |
id: cache | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Install Dependencies | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: npm i && npm ci | |
# Deploy hexo blog website. | |
- name: Deploy | |
id: deploy | |
uses: marsen/[email protected] | |
with: | |
deploy_key: ${{ secrets.DEPLOY_KEY }} | |
# user_name: marsen # (or delete this input setting to use bot account) | |
# user_email: [email protected] # (or delete this input setting to use bot account) | |
# commit_msg: ${{ github.event.head_commit.message }} # (or delete this input setting to use hexo default settings) | |
# Use the output from the `deploy` step(use for test action) | |
- name: Get the output | |
run: | | |
echo "${{ steps.deploy.outputs.notify }}" |