Skip to content

Commit eb40e67

Browse files
authored
Merge pull request #352 from smalruby/gh-page-deploy-branch
chore: deploy branch
2 parents b5d548e + 6f953d3 commit eb40e67

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

.github/workflows/ci-cd.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,3 +200,39 @@ jobs:
200200
full_commit_message: "Build for ${{ github.sha }} ${{ github.event.head_commit.message }}"
201201
cname: smalruby.app
202202
external_repository: smalruby/smalruby.app
203+
deploy-gh-pages-branch:
204+
needs: [test-integration, test-unit]
205+
if: |
206+
(!(
207+
github.ref == 'refs/heads/master' ||
208+
github.ref == 'refs/heads/develop' ||
209+
startsWith(github.ref, 'refs/heads/hotfix/') ||
210+
startsWith(github.ref, 'refs/heads/dependabot/') ||
211+
startsWith(github.ref, 'refs/heads/renovate/')
212+
))
213+
runs-on: ubuntu-latest
214+
steps:
215+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
216+
- name: Retrieve npm dependencies
217+
uses: actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3
218+
with:
219+
path:
220+
node_modules
221+
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
222+
- name: Retrieve Build Directory
223+
uses: actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3
224+
with:
225+
path:
226+
./build
227+
key: ${{ runner.os }}-build-${{ hashFiles('package-lock.json') }}
228+
- name: Set branch name
229+
id: branch
230+
run: echo "::set-output name=BRANCH_NAME::${GITHUB_REF##*/}"
231+
- name: Deploy playground to GitHub Pages
232+
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
233+
with:
234+
github_token: ${{ secrets.GITHUB_TOKEN }}
235+
publish_dir: ./build
236+
full_commit_message: "Build for ${{ steps.branch.outputs.BRANCH_NAME }} (${{ github.sha }}) ${{ github.event.head_commit.message }}"
237+
destination_dir: ${{ steps.branch.outputs.BRANCH_NAME }}
238+
keep_files: true

0 commit comments

Comments
 (0)