Create depoly.yml
This commit is contained in:
parent
60e8d53aaf
commit
f1aef5495a
1 changed files with 43 additions and 0 deletions
43
.github/workflows/depoly.yml
vendored
Normal file
43
.github/workflows/depoly.yml
vendored
Normal file
|
@ -0,0 +1,43 @@
|
|||
name: Deploy
|
||||
|
||||
on: [push]
|
||||
|
||||
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('**/yarn.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-node-
|
||||
- name: Install YARN
|
||||
- run: 'curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -'
|
||||
- run: 'echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list'
|
||||
- run: "sudo apt update && sudo apt install yarn"
|
||||
|
||||
- name: Install Dependencies
|
||||
if: steps.cache.outputs.cache-hit != 'true'
|
||||
run: yarn
|
||||
|
||||
# Deploy hexo blog website.
|
||||
- name: Deploy
|
||||
id: deploy
|
||||
uses: sma11black/hexo-action@v1.0.3
|
||||
with:
|
||||
deploy_key: ${{ secrets.DEPLOY_KEY }}
|
||||
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 }}"
|
Loading…
Reference in a new issue