-
-
Notifications
You must be signed in to change notification settings - Fork 228
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Migrate CF Pages to CF Wrangler action (based on jellyfin/jellyfin-web#5894) * Create event-based workflows, all the specific actions are now reusable workflows. * Fix labeler definition file Signed-off-by: Fernando Fernández <[email protected]>
- Loading branch information
Showing
13 changed files
with
299 additions
and
255 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,36 @@ | ||
tests: | ||
- '**/*.spec.js' | ||
- changed-files: | ||
- any-glob-to-any-file: | ||
- '**/*.spec.*' | ||
|
||
github_actions: | ||
- '.github/workflows/*' | ||
ci: | ||
- changed-files: | ||
- any-glob-to-any-file: | ||
- '.github/workflows/**/**' | ||
|
||
pinia: | ||
- 'frontend/store/**/*.ts' | ||
'frontend:store': | ||
- changed-files: | ||
- any-glob-to-any-file: | ||
- 'frontend/store/**/*.ts' | ||
|
||
plugins: | ||
- 'frontend/plugins/**/*.ts' | ||
'frontend:plugins': | ||
- changed-files: | ||
- any-glob-to-any-file: | ||
- 'frontend/plugins/**/*.ts' | ||
|
||
vue: | ||
- '**/*.vue' | ||
- changed-files: | ||
- any-glob-to-any-file: | ||
- '**/*.vue' | ||
|
||
docker: | ||
- 'Dockerfile*' | ||
packaging: | ||
- changed-files: | ||
- any-glob-to-any-file: | ||
- 'packaging/**/**' | ||
|
||
ui: | ||
- any: | ||
[ | ||
'frontend/components/**/*.vue', | ||
'frontend/layouts/**/*.vue', | ||
'frontend/pages/**/*.vue' | ||
] | ||
- changed-files: | ||
- any-glob-to-any-file: | ||
- 'frontend/components/**/*.vue' | ||
- 'frontend/layouts/**/*.vue' | ||
- 'frontend/pages/**/*.vue' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* Reusable workflows should be under a `reusable` folder. Track https://github.com/orgs/community/discussions/10773 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,15 @@ | ||
name: GitHub CodeQL 🔬 | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event_name == 'push' && github.ref || github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
paths-ignore: | ||
- '**/*.md' | ||
merge_group: | ||
workflow_call: | ||
schedule: | ||
- cron: 0 0 * * MON,FRI | ||
|
||
inputs: | ||
commit: | ||
required: true | ||
type: string | ||
jobs: | ||
analyze: | ||
name: Analyze 🔬 | ||
name: Analyze ${{ matrix.language}} 🔬 | ||
runs-on: ubuntu-latest | ||
permissions: | ||
actions: read | ||
contents: read | ||
security-events: write | ||
|
||
strategy: | ||
fail-fast: false | ||
|
@@ -35,6 +21,7 @@ jobs: | |
- name: Checkout repository ⬇️ | ||
uses: actions/[email protected] | ||
with: | ||
ref: ${{ inputs.commit }} | ||
show-progress: false | ||
|
||
- name: Initialize CodeQL 🛠️ | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Deploy 🏗️ | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
branch: | ||
required: true | ||
type: string | ||
commit: | ||
required: false | ||
type: string | ||
comment: | ||
required: false | ||
type: boolean | ||
artifact_name: | ||
required: false | ||
type: string | ||
default: frontend | ||
|
||
jobs: | ||
cf-pages: | ||
name: CloudFlare Pages 📃 | ||
runs-on: ubuntu-latest | ||
environment: ${{ inputs.branch == 'master' && 'production' || 'preview' }} | ||
outputs: | ||
url: ${{ steps.cf.outputs.deployment-url }} | ||
|
||
steps: | ||
- name: Download workflow artifact ⬇️ | ||
uses: actions/[email protected] | ||
with: | ||
name: ${{ inputs.artifact_name }} | ||
path: dist | ||
|
||
- name: Publish to Cloudflare Pages 📃 | ||
uses: cloudflare/[email protected] | ||
id: cf | ||
with: | ||
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | ||
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | ||
command: pages deploy dist --project-name=jf-vue --branch=${{ inputs.branch }} | ||
|
||
compose-comment: | ||
name: Compose and push comment 📝 | ||
# Always run so the comment is composed for the workflow summary | ||
if: ${{ always() }} | ||
uses: ./.github/workflows/__job_messages.yml | ||
secrets: inherit | ||
needs: | ||
- cf-pages | ||
|
||
with: | ||
branch: ${{ inputs.branch }} | ||
commit: ${{ inputs.commit }} | ||
preview_url: ${{ needs.cf-pages.outputs.url }} | ||
in_progress: false | ||
comment: ${{ inputs.comment }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,29 +12,23 @@ on: | |
preview_url: | ||
required: false | ||
type: string | ||
build_workflow_run_id: | ||
required: false | ||
type: number | ||
commenting_workflow_run_id: | ||
required: true | ||
type: string | ||
in_progress: | ||
required: true | ||
type: boolean | ||
outputs: | ||
msg: | ||
description: The composed message | ||
value: ${{ jobs.msg.outputs.msg }} | ||
comment: | ||
required: false | ||
type: boolean | ||
marker: | ||
description: Hidden marker to detect PR comments composed by the bot | ||
value: "CFPages-deployment" | ||
required: false | ||
type: string | ||
default: "CFPages-deployment" | ||
|
||
|
||
jobs: | ||
msg: | ||
name: Deployment status | ||
cf_pages_msg: | ||
name: CloudFlare Pages deployment status 📃🚀 | ||
runs-on: ubuntu-latest | ||
outputs: | ||
msg: ${{ env.msg }} | ||
|
||
steps: | ||
- name: Compose message 📃 | ||
|
@@ -45,8 +39,7 @@ jobs: | |
PREVIEW_URL: ${{ inputs.preview_url != '' && (inputs.branch != 'master' && inputs.preview_url || format('https://jf-vue.pages.dev ({0})', inputs.preview_url)) || 'Not available' }} | ||
DEPLOY_STATUS: ${{ inputs.in_progress && '🔄 Deploying...' || (inputs.preview_url != '' && '✅ Deployed!' || '❌ Failure. Check workflow logs for details') }} | ||
DEPLOYMENT_TYPE: ${{ inputs.branch != 'master' && '🔀 Preview' || '⚙️ Production' }} | ||
BUILD_WORKFLOW_RUN: ${{ !inputs.in_progress && format('**[View build logs](https://github.com/{0}/actions/runs/{1})**', 'jellyfin/jellyfin-vue', inputs.build_workflow_run_id) || '' }} | ||
COMMENTING_WORKFLOW_RUN: ${{ format('**[View bot logs](https://github.com/{0}/actions/runs/{1})**', 'jellyfin/jellyfin-vue', inputs.commenting_workflow_run_id) }} | ||
WORKFLOW_RUN: ${{ !inputs.in_progress && format('**[View build logs](https://github.com/{0}/actions/runs/{1})**', github.repository, github.run_id) || '' }} | ||
# EOF is needed for multiline environment variables in a GitHub Actions context | ||
run: | | ||
echo "## Cloudflare Pages deployment" > $GITHUB_STEP_SUMMARY | ||
|
@@ -57,9 +50,16 @@ jobs: | |
echo "| **Preview URL** | $PREVIEW_URL |" >> $GITHUB_STEP_SUMMARY | ||
echo "| **Type** | $DEPLOYMENT_TYPE |" >> $GITHUB_STEP_SUMMARY | ||
echo "" >> $GITHUB_STEP_SUMMARY | ||
echo "$BUILD_WORKFLOW_RUN" >> $GITHUB_STEP_SUMMARY | ||
echo "$COMMENTING_WORKFLOW_RUN" >> $GITHUB_STEP_SUMMARY | ||
echo "$WORKFLOW_RUN" >> $GITHUB_STEP_SUMMARY | ||
COMPOSED_MSG=$(cat $GITHUB_STEP_SUMMARY) | ||
echo "msg<<EOF" >> $GITHUB_ENV | ||
echo "$COMPOSED_MSG" >> $GITHUB_ENV | ||
echo "EOF" >> $GITHUB_ENV | ||
- name: Push comment to Pull Request 🔼 | ||
uses: thollander/[email protected] | ||
if: ${{ inputs.comment && steps.compose.conclusion == 'success' }} | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.JF_BOT_TOKEN }} | ||
message: ${{ env.msg }} | ||
comment_tag: ${{ inputs.marker }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ on: | |
workflow_call: | ||
inputs: | ||
commit: | ||
required: true | ||
required: false | ||
type: string | ||
tag_name: | ||
required: false | ||
|
@@ -28,10 +28,6 @@ env: | |
COMMIT_TAG: unstable | ||
DOCKER_BUILD_RECORD_UPLOAD: false | ||
|
||
permissions: | ||
id-token: write | ||
attestations: write | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
@@ -60,6 +56,7 @@ jobs: | |
- name: Checkout ⬇️ | ||
uses: actions/[email protected] | ||
with: | ||
ref: ${{ inputs.commit || github.sha }} | ||
show-progress: false | ||
|
||
- name: Setup node environment ⚙️ | ||
|
@@ -169,6 +166,7 @@ jobs: | |
- name: Checkout ⬇️ | ||
uses: actions/[email protected] | ||
with: | ||
ref: ${{ inputs.commit || github.sha }} | ||
show-progress: false | ||
|
||
- name: Configure QEMU ⚙️ | ||
|
@@ -262,6 +260,7 @@ jobs: | |
- name: Checkout ⬇️ | ||
uses: actions/[email protected] | ||
with: | ||
ref: ${{ inputs.commit || github.sha }} | ||
show-progress: false | ||
|
||
- name: Configure QEMU ⚙️ | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,11 @@ | ||
name: Quality checks 👌🧪 | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
on: | ||
pull_request: | ||
paths-ignore: | ||
- '**/*.md' | ||
merge_group: | ||
schedule: | ||
- cron: 30 7 * * 6 | ||
workflow_call: | ||
inputs: | ||
commit: | ||
required: true | ||
type: string | ||
workflow_dispatch: | ||
|
||
jobs: | ||
|
@@ -21,6 +16,7 @@ jobs: | |
- name: Checkout Repository | ||
uses: actions/[email protected] | ||
with: | ||
ref: ${{ inputs.commit }} | ||
show-progress: false | ||
|
||
- name: Scan | ||
|
@@ -42,6 +38,7 @@ jobs: | |
- name: Checkout ⬇️ | ||
uses: actions/[email protected] | ||
with: | ||
ref: ${{ inputs.commit }} | ||
show-progress: false | ||
|
||
- name: Setup node environment ⚙️ | ||
|
@@ -67,6 +64,7 @@ jobs: | |
- name: Checkout ⬇️ | ||
uses: actions/[email protected] | ||
with: | ||
ref: ${{ inputs.commit }} | ||
show-progress: false | ||
|
||
- name: Setup node environment ⚙️ | ||
|
@@ -81,21 +79,15 @@ jobs: | |
- name: Run typecheck 📖 | ||
run: npm run typecheck | ||
|
||
build: | ||
name: Build 🏗️ | ||
uses: ./.github/workflows/package.yml | ||
with: | ||
commit: ${{ github.sha }} | ||
|
||
conventional_commits: | ||
name: Conventional commits check 💬 | ||
if: ${{ github.event_name == 'pull_request' || github.event_name == 'merge_group' }} | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout ⬇️ | ||
uses: actions/[email protected] | ||
with: | ||
ref: ${{ inputs.commit }} | ||
show-progress: false | ||
|
||
- name: Check if all commits comply with the specification | ||
|
Oops, something went wrong.