Update Site every 12 Hours #353
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: Update Site every 12 Hours | |
| on: | |
| schedule: | |
| - cron: "0 */12 * * *" | |
| jobs: | |
| Generate-Winget-Pkgs-Db: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repository code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: "recursive" | |
| - name: Pull Latest Changes from Winget-Pkgs | |
| run: | | |
| cd winget-pkgs && git submodule update --remote --recursive --merge | |
| - name: List files in the repository | |
| run: | | |
| cd .. && ls ${{ github.workspace }} | |
| - name: Install Dependencies | |
| run: "pip3 install -r requirements.txt" | |
| - name: Export Winget Database | |
| run: "python3 main.py" | |
| - name: Archive Database | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: winget-pkg-db.db | |
| path: ${{ github.workspace }}/winget-pkg-app.db | |
| Deploy-Github-Pages: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| needs: Generate-Winget-Pkgs-Db | |
| steps: | |
| - name: Clone repository | |
| uses: actions/checkout@v4 | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: winget-pkg-db.db | |
| path: ${{ github.workspace }}/frontend/ | |
| - name: Setup Deno environment | |
| uses: denoland/setup-deno@v2 | |
| - name: Build site | |
| run: | | |
| cd frontend && deno task build_prod | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v3 | |
| - name: Upload artifact | |
| uses: actions/upload-pages-artifact@v2 | |
| with: | |
| path: "${{ github.workspace }}/frontend/_site" | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v1 |