Home
About
Blog
Products
Forum
Support
Contact
Sunbelt Computer Software
PL/B Language Development and Support
Home
About
Blog
Products
Forum
Support
Contact
diffusers/.github/workflows/mirror_community_pipeline.yml at main · iamwavecut/diffusers · GitHub
Skip to content
Navigation Menu
Sign in
Products
Platform
GitHub
Repository hosting, code review, and collaboration
Copilot
AI coding agent for tasks, projects and automated work
Build & Ship
Actions
CI/CD and automation
Code Quality
Quality analysis, fixes, and enforcement
Codespaces
Cloud development environments
Secure
Code Security
Vulnerability detection and remediation
Secret Protection
Secret scanning and leak prevention
All Features
Developers
Learn
Documentation
Training
Certifications
Build
Build with Copilot
Customize Copilot
Integrations
Explore
Trending repos
GitHub Sponsors
Events
Changelog
Changelog
Your source for the latest features, improvements, and fixes across GitHub products, all in one place.
Businesses
By Stage
Enterprises
Team
Startups
Nonprofits
By Industry
Healthcare
Financial services
Manufacturing
Government
See all industries
Evaluate GitHub
Why GitHub
Customer Stories
Business insights
Trust Center
Add-ons
GitHub Advanced Security
Enterprise-grade code security
Copilot for business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Resources
Learn & Connect
Documentation
Resource center
Blog
Events & webinars
Community Forum
Customer Stories
Integrations
Support
Customer support
Training
GitHub Status
Company
About
Partners
Changelog
GitHub Universe
GitHub Universe
The event for developers, by developers — talks, workshops, and what’s next for GitHub.
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
iamwavecut
diffusers
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
main
Breadcrumbs
diffusers
/
.github
/
workflows
/
mirror_community_pipeline.yml
Copy path
View runs
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
102 lines (92 loc) · 3.49 KB
main
Breadcrumbs
diffusers
/
.github
/
workflows
/
mirror_community_pipeline.yml
Copy path
Top
File metadata and controls
Code
Blame
102 lines (92 loc) · 3.49 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name
:
Mirror Community Pipeline
on
:
#
Push changes on the main branch
push
:
branches
:
-
main
paths
:
-
'
examples/community/**.py
'
#
And on tag creation (e.g. `v0.28.1`)
tags
:
-
'
*
'
#
Manual trigger with ref input
workflow_dispatch
:
inputs
:
ref
:
description
:
"
Either 'main' or a tag ref
"
required
:
true
default
:
'
main
'
jobs
:
mirror_community_pipeline
:
env
:
SLACK_WEBHOOK_URL
:
${{ secrets.SLACK_WEBHOOK_URL_COMMUNITY_MIRROR }}
runs-on
:
ubuntu-22.04
steps
:
#
Checkout to correct ref
#
If workflow dispatch
#
If ref is 'main', set:
#
CHECKOUT_REF=refs/heads/main
#
PATH_IN_REPO=main
#
Else it must be a tag. Set:
#
CHECKOUT_REF=refs/tags/{tag}
#
PATH_IN_REPO={tag}
#
If not workflow dispatch
#
If ref is 'refs/heads/main' => set 'main'
#
Else it must be a tag => set {tag}
-
name
:
Set checkout_ref and path_in_repo
run
:
|
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
if [ -z "${{ github.event.inputs.ref }}" ]; then
echo "Error: Missing ref input"
exit 1
elif [ "${{ github.event.inputs.ref }}" == "main" ]; then
echo "CHECKOUT_REF=refs/heads/main" >> $GITHUB_ENV
echo "PATH_IN_REPO=main" >> $GITHUB_ENV
else
echo "CHECKOUT_REF=refs/tags/${{ github.event.inputs.ref }}" >> $GITHUB_ENV
echo "PATH_IN_REPO=${{ github.event.inputs.ref }}" >> $GITHUB_ENV
fi
elif [ "${{ github.ref }}" == "refs/heads/main" ]; then
echo "CHECKOUT_REF=${{ github.ref }}" >> $GITHUB_ENV
echo "PATH_IN_REPO=main" >> $GITHUB_ENV
else
# e.g. refs/tags/v0.28.1 -> v0.28.1
echo "CHECKOUT_REF=${{ github.ref }}" >> $GITHUB_ENV
echo "PATH_IN_REPO=$(echo ${{ github.ref }} | sed 's/^refs\/tags\///')" >> $GITHUB_ENV
fi
-
name
:
Print env vars
run
:
|
echo "CHECKOUT_REF: ${{ env.CHECKOUT_REF }}"
echo "PATH_IN_REPO: ${{ env.PATH_IN_REPO }}"
-
uses
:
actions/checkout@v3
with
:
ref
:
${{ env.CHECKOUT_REF }}
#
Setup + install dependencies
-
name
:
Set up Python
uses
:
actions/setup-python@v4
with
:
python-version
:
"
3.10
"
-
name
:
Install dependencies
run
:
|
python -m pip install --upgrade pip
pip install --upgrade huggingface_hub
#
Check secret is set
-
name
:
whoami
run
:
huggingface-cli whoami
env
:
HF_TOKEN
:
${{ secrets.HF_TOKEN_MIRROR_COMMUNITY_PIPELINES }}
#
Push to HF! (under subfolder based on checkout ref)
#
https://huggingface.co/datasets/diffusers/community-pipelines-mirror
-
name
:
Mirror community pipeline to HF
run
:
huggingface-cli upload diffusers/community-pipelines-mirror ./examples/community ${PATH_IN_REPO} --repo-type dataset
env
:
PATH_IN_REPO
:
${{ env.PATH_IN_REPO }}
HF_TOKEN
:
${{ secrets.HF_TOKEN_MIRROR_COMMUNITY_PIPELINES }}
-
name
:
Report success status
if
:
${{ success() }}
run
:
|
pip install requests && python utils/notify_community_pipelines_mirror.py --status=success
-
name
:
Report failure status
if
:
${{ failure() }}
run
:
|
pip install requests && python utils/notify_community_pipelines_mirror.py --status=failure
You can’t perform that action at this time.