Deploy Jekyll site with Data Processing #274
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: Deploy Jekyll site with Data Processing | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
env: | |
OMEKA_API_URL: ${{ secrets.OMEKA_API_URL }} | |
KEY_IDENTITY: ${{ secrets.KEY_IDENTITY }} | |
KEY_CREDENTIAL: ${{ secrets.KEY_CREDENTIAL }} | |
ITEM_SET_ID: ${{ secrets.ITEM_SET_ID }} | |
jobs: | |
data-processing: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: astral-sh/setup-uv@v3 | |
with: | |
enable-cache: true | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.13' | |
- run: uv run .github/workflows/process_data.py | |
- name: Upload sgb-metadata-csv.csv | |
uses: actions/upload-artifact@v4 | |
with: | |
name: sgb-metadata-csv | |
path: _data/sgb-metadata-csv.csv | |
- name: Upload sgb-metadata-json.json | |
uses: actions/upload-artifact@v4 | |
with: | |
name: sgb-metadata-json | |
path: _data/sgb-metadata-json.json | |
- name: Upload objects folder | |
uses: actions/upload-artifact@v4 | |
with: | |
name: objects | |
path: objects | |
build: | |
needs: data-processing | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Download sgb-metadata-csv.csv | |
uses: actions/download-artifact@v4 | |
with: | |
name: sgb-metadata-csv | |
path: _data | |
- name: Download sgb-metadata-json.json | |
uses: actions/download-artifact@v4 | |
with: | |
name: sgb-metadata-json | |
path: _data | |
- name: Download objects folder | |
uses: actions/download-artifact@v4 | |
with: | |
name: objects | |
path: objects | |
- name: Setup Ruby | |
uses: ruby/setup-ruby@8575951200e472d5f2d95c625da0c7bec8217c42 # v1.161.0 | |
with: | |
bundler-cache: true | |
cache-version: 0 | |
- name: Setup Pages | |
id: pages | |
uses: actions/configure-pages@v4 | |
- name: Build with Jekyll | |
run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}" | |
env: | |
JEKYLL_ENV: production | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v3 | |
deploy: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} |