diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index cea1c09..184cd6a 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,9 +1,27 @@ -name: Post my words to my own blog site -on: [push] +name: Deploy to Site + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +# Default to bash +defaults: + run: + shell: bash + jobs: - post-my-words: + build: runs-on: ubuntu-latest + environment: production steps: - - name: Trigger my blog site to import from my-words + - name: Trigger Deploy to Site run: | - curl --location --request POST 'zou8944.com/import' \ No newline at end of file + curl -L \ + -X POST \ + -H "Accept: application/vnd.github+json" \ + -H "Authorization: Bearer ${{ secrets.PAT }}" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + https://api.github.com/repos/zou8944/my-blog-hexo/dispatches \ + -d "{\"event_type\": \"trigger-workflow\", \"client_payload\": {\"unit\": false, \"integration\": true}}" \ No newline at end of file