In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article mainly explains "what is the workflow of GitHub Actions blog posting". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn "what is the workflow of GitHub Actions blog posting?"
Version library
First, we create a repository on Github to store blog data. Hugo is recommended for static blogs, which is very simple. Using the Markdown syntax, officials provide a lot of good theme templates.
Here I use the trunk main branch to store the project code and create a separate branch to store the compiled static HTML resource file. Let's switch to another branch and take a look:
Work panel
Create a new workboard to customize the status and simply record each blog optimization requirement here. Each task here can be converted to issue, and the submission code can be associated with the corresponding issue.
CI/CD integration and release
Use Github actions as the build. The settings are built when the code is submitted in the main branch.
Name: github pages on: push: branches: [main]
Check out the trunk branch code and delete the pages-git branch (which holds static files and needs to be updated frequently).
Jobs: deploy: runs-on: ubuntu-18.04 steps:-uses: actions/checkout@v2 with: submodules: true # Fetch Hugo themes (true OR recursive) fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod-name: Delete branch uses: dawidd6/action-delete-branch@v3 with: github_token: ${{ Secrets.GIT_TOKEN}} branches: "pages-git"
Hugo-- minify generates a static file public directory.
-name: Setup Hugo uses: peaceiris/actions-hugo@v2 with: hugo-version: '0.74.2' # extended: true-name: Build run: | hugo--minify ls public tar zcf ${version}-public.tar.gz public ls
Delete all files in the current directory except the public directory, and then move the public directory files to the current directory.
Ls-l rm-fr public git config-global user.email xxx@qq.com git config-global user.name cccc git add. Git commit-m "update"-a
Submit the current working directory to the pages-git branch. (the updated static file has been stored in the pages-git branch)
-name: Push changes uses: ad-m/github-push-action@master with: github_token: ${{secrets.GIT_TOKEN}} branch: "pages-git"
Github pages access is too slow, ready to use domestic gitee pages services. Create a warehouse in gitee. The last part of the code mirrors the current pages-git branch code to the pages-git branch of the gitee project.
-name: 'get code' uses: actions/checkout@v2 with: submodules: true # Fetch Hugo themes (true OR recursive) fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod ref: "pages-git"-name: 'Mirror to gitee' uses: pixta-dev/repository-mirroring-action@v1 with: target _ repo_url: git@gitee.com:devopsgo/devopsgo.git ssh_private_key: ${{secrets.GIT_PRIVATE_KEY}}
At this point, the code has been synchronized to Gitee Pages. Next, the Gitee Pages service update is triggered. (specify static directory branch deployment)
Browsers can access devopsgo.gitee.io. At this point, the release is complete.
The workflow has been created, and finally every time a blog post is posted. Use vscode to write markdown documentation, and then debug it locally with hugo serve. Submit it to the trunk branch after completion, and then GitHub Actions will run CI/CD and publish automatically.
#-name: copy file via ssh password # uses: appleboy/scp-action@master # with: # host: ${{secrets.SSH_HOST}} # username: ${{secrets.SSH_USER}} # password: ${{secrets.SSH_PASSWD}} # port: 22 # source: ". / ${{env.version}}-public.tar.gz" # target: "/ opt/" #-name: executing remote ssh commands using password # uses: appleboy/ssh-action@master # with: # host: ${secrets.SSH_HOST}} # username: ${{secrets.SSH_USER}} # password: ${{secrets.SSH_PASSWD}} # port: 22 # script: | # rm-fr / var/www/newdevops/* # mv / opt/$ {{env.version}}-public.tar.gz / var/www/newdevops/ # cd / var/www/newdevops/ & & tar zxf ${{env.version}}-public.tar.gz # mv public/*. / & & rm-fr public # chown nginx:nginx / var/www/ -R # systemctl reload nginx so far I believe that you have a deeper understanding of "what is the workflow of GitHub Actions blog posting", you might as well do it in practice! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.