Skip to content

Commit

Permalink
ci: use reusable workflows in hasundue/actions
Browse files Browse the repository at this point in the history
  • Loading branch information
hasundue committed Oct 23, 2023
1 parent 064b65f commit 697fa7a
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 95 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: CI/CD

on:
push:
branches:
- main

permissions:
contents: write
pull-requests: write

jobs:
test:
name: Test
uses: hasundue/actions/.github/workflows/test-deno.yml@main
secrets: inherit

release:
name: Create PR for release
needs: test
uses: hasundue/actions@main/.github/workflows/release.yml@main
with:
package-name: 'molt'
32 changes: 0 additions & 32 deletions .github/workflows/deno.yml

This file was deleted.

21 changes: 0 additions & 21 deletions .github/workflows/release.yml

This file was deleted.

15 changes: 15 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Test

on:
pull_request:
branches:
- main

permissions:
contents: read

jobs:
test:
name: Test
uses: hasundue/actions/.github/workflows/test-deno.yml@main
secrets: inherit
47 changes: 5 additions & 42 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Update
name: Update Deno modules

on:
schedule:
- cron: '0 0 * * *'
- cron: '0 23 * * *'
workflow_dispatch:

permissions:
Expand All @@ -11,43 +11,6 @@ permissions:

jobs:
update:
name: Update
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Configure Git
run: |
git config user.name github-actions[bot]
git config user.email github-actions[bot]@users.noreply.github.com
- name: Setup Deno
uses: denoland/setup-deno@v1
with:
deno-version: v1.x

- name: Cache dependencies
run: deno task cache

- name: Run Molt
run: deno task update:commit --summary title.txt --report body.md

- name: Check result
id: result
uses: andstor/file-existence-action@v2
with:
files: title.txt, body.md

- name: Push changes
if: steps.result.outputs.files_exists == 'true'
run: git push -f origin HEAD:build/update-dependencies

- name: Create Pull Request
if: steps.result.outputs.files_exists == 'true'
run: |
gh pr create --title "$(cat title.txt)" --body "$(cat body.txt)"
--head build/update-dependencies
env:
GH_TOKEN: ${{ secrets.PAT_UPDATE }}
name: Main
uses: hasundue/actions/.github/workflows/update-deno.yml@main
secrets: inherit

0 comments on commit 697fa7a

Please sign in to comment.