Skip to content

Commit

Permalink
chore: allow running build and sync manually with specific tag
Browse files Browse the repository at this point in the history
  • Loading branch information
ccoreilly committed Dec 29, 2024
1 parent 102b42f commit d880b6c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
required: false
type: boolean
default: false
tag:
required: false
type: string
secrets:
DUBBING_API_BASE_URL:
required: false
Expand All @@ -20,6 +23,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.tag || github.ref }}

- name: Use Node.js
uses: actions/setup-node@v4
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/sync-to-wp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,18 @@ name: Sync to WordPress Theme
on:
release:
types: [published]
workflow_dispatch:
inputs:
tag:
description: "Tag to sync (e.g. v1.0.0)"
required: true
type: string

jobs:
build:
uses: ./.github/workflows/build.yml
with:
tag: ${{ inputs.tag || github.event.release.tag_name }}
secrets:
DUBBING_API_BASE_URL: ${{ secrets.DUBBING_API_BASE_URL }}
TRANSCRIPTION_API_BASE_URL: ${{ secrets.TRANSCRIPTION_API_BASE_URL }}
Expand Down Expand Up @@ -55,5 +63,5 @@ jobs:
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add static/js/subdub-editor.js
git commit -m "Update subdub-editor.js to version ${{ github.event.release.tag_name }}"
git commit -m "Update subdub-editor.js to version ${{ github.event.release.tag_name || inputs.tag }}"
git push origin HEAD:master

0 comments on commit d880b6c

Please sign in to comment.