update #449
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: update | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 * * *' | |
jobs: | |
main: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: tibdex/[email protected] | |
if: ${{ !env.ACT }} | |
id: create-app-token | |
with: | |
app_id: ${{ secrets.APP_ID }} | |
private_key: ${{ secrets.APP_PRIVATE_KEY }} | |
- uses: actions/checkout@v3 | |
if: ${{ !env.ACT }} | |
with: | |
token: ${{ steps.create-app-token.outputs.token }} | |
- name: setup git | |
run: | | |
git config user.name "iptv-bot[bot]" | |
git config user.email "84861620+iptv-bot[bot]@users.noreply.github.com" | |
- uses: actions/setup-node@v3 | |
if: ${{ !env.ACT }} | |
with: | |
node-version: 22 | |
cache: 'npm' | |
- name: install dependencies | |
run: npm install | |
- name: check *.channels.xml | |
run: | | |
npm run channels:lint | |
- name: update sites.md | |
run: npm run sites:update | |
- run: git status | |
- name: commit changes to sites.md | |
if: ${{ !env.ACT && github.ref == 'refs/heads/master' }} | |
run: | | |
SITE=SITES.md | |
CHANGED=$(git diff ${SITE}) | |
if [ -n "${CHANGED}" ]; then | |
git add ${SITE} | |
git commit -m "[Bot] Update ${SITE}" -m "Committed by [iptv-bot](https://github.com/apps/iptv-bot) via [update](https://github.com/iptv-org/epg/actions/runs/${{ github.run_id }}) workflow." --no-verify | |
git push | |
fi | |
- name: generate .api/guides.json | |
run: npm run api:generate | |
- run: git status | |
- name: move .api/guides.json to iptv-org/api | |
uses: JamesIves/[email protected] | |
if: ${{ !env.ACT && github.ref == 'refs/heads/master' }} | |
with: | |
repository-name: iptv-org/api | |
branch: gh-pages | |
folder: .api | |
token: ${{ steps.create-app-token.outputs.token }} | |
git-config-name: iptv-bot[bot] | |
git-config-email: 84861620+iptv-bot[bot]@users.noreply.github.com | |
commit-message: '[Bot] Deploy to iptv-org/api' | |
clean: false |