Travis CI. Today, try compiling Vue using Github Action and Posting it to Github page. Action is very simple. Create a.github/workflow/xx.yml file in the project root directory. Let’s take a look at my CI file

name: build site  The name of action

on:               # Trigger the Workflow event. I mean this only happens when the Master branch pushes
  push:
    branches:
      - master

jobs:
  build:
    runs-on: ubuntu-latest  # Environment image

    steps:
      - uses: actions/checkout@master Run instructions for the steps
      - uses: actions/setup-node@master Set up the NodeJS environment
      - name: build
        run: | yarn yarn build      - name: deploy
        uses: peaceiris/actions-gh-pages@v3
        with:
          github_token: The ${{ secrets.GITHUB_TOKEN }}
          publish_dir: ./dist
Copy the code

I’ve highlighted some of the comments in the configuration file above, the run field is not marked and below it is the script, with is used to set some values. The deploy phase of the job mainly uses third-party libraries to dump compiled static code into the GH-Pages branch. Push the code to master, click on action to see that the task has been executed, and when it is finished, you can see that our changes have been updated to the page.