ci: Package action automatically on release branch (#15)

This commit is contained in:
Samuel Ryan 2022-12-02 16:37:11 +00:00 committed by GitHub
parent abde1147dd
commit 917745b929
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 161 additions and 1623 deletions

35
.github/workflows/package-action.yaml vendored Normal file
View file

@ -0,0 +1,35 @@
name: "Package Action"
on:
push:
branches:
- "main"
env:
source: "main"
release: "release"
jobs:
package-changes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: "${{ env.release }}"
fetch-depth: 0
ssh-key: "${{ secrets.COMMIT_KEY }}"
- uses: pr-mpt/actions-merge-branch@v2
with:
from: "origin/${{ env.source }}"
commit: false
- name: Install Javascript dependencies with npm
run: npm install
- name: Package action for distribution
run: npm run package
- name: Push packaged action to branch
uses: EndBug/add-and-commit@v7
with:
add: "['.', 'dist --force']"
branch: "${{ env.release }}"
default_author: github_actions
message: "build: Package action as `dist` with latest changes"