diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1573c215a1f6..94b9a2b56b8b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,15 +1,16 @@ name: Publish on: - push: - branches: - - main - workflow_dispatch: + pull_request: +# push: +# branches: +# - main +# workflow_dispatch: -permissions: - contents: read - pages: write - id-token: write +#permissions: +# contents: read +# pages: write +# id-token: write # Allow one concurrent deployment concurrency: @@ -23,9 +24,9 @@ env: jobs: publish: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} +# environment: +# name: github-pages +# url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest steps: - name: Checkout @@ -45,8 +46,15 @@ jobs: - name: Build all translations run: | + set -x + for po_lang in ${{ env.LANGUAGES }}; do echo "::group::Building $po_lang translation" + POT_CREATION_DATE=$(grep --max-count 1 '^"POT-Creation-Date:' po/$po_lang.po | sed -E 's/".*: (.*)\\n"/\1/') + if [[ $POT_CREATION_DATE == "" ]]; then + POT_CREATION_DATE=now + fi + git checkout "main@{$POT_CREATION_DATE}" src MDBOOK_BOOK__LANGUAGE=$po_lang \ MDBOOK_OUTPUT__HTML__SITE_URL=/comprehensive-rust/$po_lang/ \ mdbook build -d book/$po_lang @@ -55,14 +63,14 @@ jobs: echo "::endgroup::" done - - name: Setup Pages - uses: actions/configure-pages@v2 - - - name: Upload artifact - uses: actions/upload-pages-artifact@v1 - with: - path: book/html - - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v1 +# - name: Setup Pages +# uses: actions/configure-pages@v2 +# +# - name: Upload artifact +# uses: actions/upload-pages-artifact@v1 +# with: +# path: book/html +# +# - name: Deploy to GitHub Pages +# id: deployment +# uses: actions/deploy-pages@v1