Skip to content

Deploy

Deploy #38

Workflow file for this run

name: Deploy
on:
workflow_dispatch:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Setup Hexo
run: |
npm install hexo-cli -g
npm install
- name: Deploy to COS
env:
COS_SECRET_ID: ${{ secrets.COS_SECRET_ID }}
COS_SECRET_KEY: ${{ secrets.COS_SECRET_KEY }}
COS_BUCKET: ${{ secrets.COS_BUCKET }}
COS_REGION: ${{ secrets.COS_REGION }}
run: |
hexo clean && hexo g && hexo d
- name: Deploy to Github Pages
env:
GH_REF: github.com/myloft/blog
CI_TOKEN: ${{ secrets.CI_TOKEN }}
run: |
git clone https://${GH_REF} .deploy_git
cd .deploy_git
git checkout master
cd ../
mv .deploy_git/.git/ ./public/
cd ./public
git init
git config user.name "Solyn"
git config user.email "[email protected]"
git add .
git commit -m ":memo: Update blog by Actions"
git push --force --quiet "https://${CI_TOKEN}@${GH_REF}" master:gh-pages