linux-publish_techblog-main_web_site #18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #部署 | |
| name: "linux-publish_techblog-main_web_site" | |
| on: | |
| # push: | |
| # branches: | |
| # - master | |
| # paths-ignore: | |
| # # - .github/workflows/pub_web.yml | |
| # - .gitignore | |
| # - README.md | |
| # - LICENSE | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| # Allow one concurrent deployment | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: true | |
| jobs: | |
| build-docs: | |
| runs-on: ubuntu-latest | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| # - name: Checkout | |
| # uses: actions/checkout@v4 | |
| # with: | |
| # fetch-depth: 1 | |
| # submodules: true | |
| # Checkout other repo | |
| - name: 检出其他仓库Checkout other repo | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: linjonh/ffmpeg-docs-website | |
| branch: pytorch_tutorial_website | |
| fetch-depth: 0 | |
| token: ${{ secrets.PAT_TOKEN }} | |
| path: pytorch-tutorial | |
| - name: List checked out files | |
| run: | | |
| ls -alh pytorch-tutorial || echo "pytorch-tutorial not found" | |
| cd pytorch-tutorial | |
| git branch -a | |
| git checkout -b pytorch_tutorial_website origin/pytorch_tutorial_website | |
| ls -alh | |
| # #build | |
| # - name: Set up Ruby | |
| # uses: ruby/setup-ruby@v1 | |
| # with: | |
| # ruby-version: '3.4.2' # 替换为你项目实际使用的版本 | |
| # bundler-cache: true | |
| # # Install ruby dependencies | |
| # - name: Install dependencies and build site | |
| # run: | | |
| # pwd | |
| # ls -lh | |
| # cd TechBlog | |
| # git branch -a | |
| # git checkout main | |
| # gem install bundler | |
| # bundle install --jobs 4 --retry 3 | |
| # # build site | |
| # bundle exec jekyll build -d "_site" --trace | |
| # env: | |
| # JEKYLL_ENV: production | |
| #Setup pages | |
| - name: Setup Pages | |
| id: pages | |
| uses: actions/configure-pages@v4 | |
| # Upload the site artifact | |
| - name: Upload site artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: "pytorch-tutorial/html_zh_CN" | |
| deploy: | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: build-docs | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |