chore: update tokens 1.7.0 (#422) #189
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: Deploy Dartdoc with GitHub Pages dependencies preinstalled | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - develop | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| with: | |
| submodules: recursive | |
| - name: Setup Dart | |
| uses: dart-lang/setup-dart@v1 | |
| with: | |
| sdk: stable | |
| - name: Setup environment | |
| uses: ./.github/actions/setup | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v3 | |
| - name: Setup Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: 3.3.5 | |
| - name: Build with Dartdoc | |
| run: | | |
| cd ouds_core | |
| dart pub get | |
| dart doc . | |
| - name: Move DartDoc output | |
| run: | | |
| mkdir -p ./docs | |
| mv ouds_core/doc/api/* ./docs | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: ./docs | |
| deploy: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v2 | |
| - name: Download artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: github-pages | |
| - name: List files in current directory (to verify artifact) | |
| run: | | |
| ls -la | |
| - name: Create docs directory if not exists | |
| run: | | |
| mkdir -p ./docs | |
| - name: Extract artifact into docs directory | |
| run: | | |
| tar -xvf artifact.tar -C ./docs | |
| ls -la ./docs | |
| - name: Commit changes and push to gh-pages | |
| run: | | |
| git config --global user.name "GitHub Actions" | |
| git config --global user.email "[email protected]" | |
| git checkout gh-pages || git checkout -b gh-pages | |
| git rm -rf . | |
| echo "flutter.unified-design-system.orange.com" > docs/CNAME | |
| git add ./docs/* | |
| commit_message="doc: deploy site to GitHub Pages - Version $(date +%Y%m%d)" | |
| git commit -m "$commit_message" || echo "No changes to commit" | |
| git push origin gh-pages --force | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |