update env #58
This file contains 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: CI | |
on: | |
push: | |
schedule: | |
- cron: "0 0 */5 * *" | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
PYTHONUTF8: 1 | |
CACHEKEY: dist | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
- name: Free Disk Space (Ubuntu) | |
uses: jlumbroso/free-disk-space@main | |
- uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-file: env.yaml | |
cache-environment: true | |
post-cleanup: 'all' | |
- name: Prepare env | |
run: | | |
sed -i 's/\"package\"/\"image\"/' ./config.json | |
- name: Restore cache | |
uses: actions/cache/restore@v3 | |
id: cache-restore | |
with: | |
path: ./dist | |
key: ${{ env.CACHEKEY }} | |
- name: Force update | |
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && startsWith(github.event.head_commit.message, '[update]') }} | |
run: | | |
rm ./dist/process.json | |
- name: Run processing | |
shell: micromamba-shell {0} | |
run: | | |
python -m index.mProcess | |
- name: Run indexing | |
shell: micromamba-shell {0} | |
run: | | |
python -m index.mIndex | |
- name: Upload pages artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: ./dist | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist | |
path: ./dist | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: cache | |
path: | | |
./cache | |
!./cache/*/wheels | |
- name: Delete previous cache | |
if: ${{ steps.cache-restore.outputs.cache-hit }} | |
continue-on-error: true | |
run: | | |
gh extension install actions/gh-actions-cache | |
gh actions-cache delete "${{ env.CACHEKEY }}" --confirm | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Save cache | |
uses: actions/cache/save@v3 | |
id: cache-save | |
with: | |
path: ./dist | |
key: ${{ env.CACHEKEY }} | |
# uses: JamesIves/github-pages-deploy-action@v4 | |
# with: | |
# token: ${{ secrets.PA_TOKEN }} | |
# branch: gh-pages | |
# folder: ./dist | |
deploy: | |
needs: build | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |