Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split website workflow #4

Merged
merged 1 commit into from
Jun 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 33 additions & 15 deletions .github/workflows/conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
pull_request:
workflow_dispatch:
schedule:
- cron: "20 * * * *" # Every 1h
- cron: "20 * * * *" # Every 1h

concurrency:
# Concurrency group that uses the workflow name and PR number if available
Expand Down Expand Up @@ -57,47 +57,66 @@ jobs:
channel: conda-forge
subdirs: ${{ steps.args.outputs.subdirs }}
keep-trees: ${{ steps.args.outputs.keep-trees }}
gh-pages-branch: '' # Disable so we do it manually below
gh-pages-branch: "" # Disable so we do it manually below
served-at: "https://github.com/napari/pins/releases/download/${{ steps.args.outputs.subchannel-name }}"
- name: Get current time
uses: josStorer/get-current-time@060cae3fbd32c181c6841788189a601ac8df8389 # v2.1.2
id: current-time
with:
format: "YYYY-MM-DD HH:MM:SS"
utcOffset: "+00:00"
utcOffset: "+00:00"
- uses: actions/upload-artifact@v4
with:
name: subchannel-${{ steps.args.outputs.subchannel-name }}
path: ${{ steps.subchannel.outputs.output-directory }}

publish:
publish-website:
runs-on: ubuntu-latest
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || github.ref == 'refs/heads/main'
needs: [build]
permissions:
contents: write # to deploy to GH Pages & Releases
contents: write # to deploy to GH Pages
strategy:
matrix:
subdir: ${{ fromJson(needs.build.outputs.subdirs) }}
version: ${{ fromJson(needs.build.outputs.versions) }}
steps:
- name: Retrieve release distributions
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: subchannel-${{ needs.build.outputs.subchannel-prefix }}${{ matrix.version }}
path: pub/
- name: List repodata files
run: ls -alh ${{ matrix.subdir }}/repodata.*
run: ls -alh conda/
- uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
if: matrix.subdir == 'noarch'
with:
github_token: ${{ github.token }}
publish_branch: gh-pages
publish_dir: ./
publish_dir: pub/
destination_dir: conda/${{ needs.build.outputs.subchannel-prefix }}${{ matrix.version }}
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
user_name: "github-actions[bot]"
user_email: "github-actions[bot]@users.noreply.github.com"
enable_jekyll: false
exclude_assets: '.github,**.json,**.bz2,**.zst'
exclude_assets: ".github,**.json,**.bz2,**.zst"
keep_files: false
force_orphan: true

publish-repodata:
runs-on: ubuntu-latest
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || github.ref == 'refs/heads/main'
needs: [build]
permissions:
contents: write # to deploy to GH Releases
strategy:
matrix:
subdir: ${{ fromJson(needs.build.outputs.subdirs) }}
version: ${{ fromJson(needs.build.outputs.versions) }}
steps:
- name: Retrieve release distributions
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
name: subchannel-${{ needs.build.outputs.subchannel-prefix }}${{ matrix.version }}
- name: List repodata files
run: ls -alh ${{ matrix.subdir }}/repodata.*
- name: Upload conda repodata for ${{ matrix.subdir }}
uses: softprops/action-gh-release@69320dbe05506a9a39fc8ae11030b214ec2d1f87 # v2.0.5
with:
Expand All @@ -110,11 +129,10 @@ jobs:
${{ matrix.subdir }}/*.json.zst
fail_on_unmatched_files: true
body: |
Repodata for ${{ needs.build.outputs.subchannel-prefix }}${{ matrix.version }}/${{ matrix.subdir }} subchannel.
Last updated on ${{ needs.build.outputs.lastmodtime }}.
Repodata for `${{ needs.build.outputs.subchannel-prefix }}${{ matrix.version }}/${{ matrix.subdir }}` subchannel.
Last updated on ${{ needs.build.outputs.lastmodtime }} UTC.
See the README for more information.


keepalive-job:
name: Keep workflow alive
runs-on: ubuntu-latest
Expand Down