mirror of
https://github.com/JamesIves/github-pages-deploy-action.git
synced 2023-12-15 20:03:39 +08:00
Add workflow to update build and node_modules on release branches (#541)
This commit is contained in:
parent
79dbd5183d
commit
0da20f04b8
50
.github/workflows/production.yml
vendored
Normal file
50
.github/workflows/production.yml
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
name: Land production js and modules
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- 'releases/v*'
|
||||
tags-ignore:
|
||||
- '*.*'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build production
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- uses: actions/setup-node@v1.4.4
|
||||
with:
|
||||
node-version: 'v12.18.4'
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
|
||||
- name: Install Yarn
|
||||
run: npm install -g yarn
|
||||
|
||||
- name: Clobber lib
|
||||
run: rm -rf lib
|
||||
|
||||
- name: Set up .gitignore
|
||||
run: |
|
||||
sed -i -e's/^lib/# lib/' -e's/^node_module/# node_modules/' .gitignore
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
yarn install
|
||||
yarn build
|
||||
|
||||
- name: Production node_modules
|
||||
run: |
|
||||
yarn install --production
|
||||
|
||||
- name: Commit and push
|
||||
# keep the run green if the commit fails for the lack of changes
|
||||
continue-on-error: True
|
||||
run: |
|
||||
git config user.email "iam@jamesiv.es"
|
||||
git config user.name "James Ives"
|
||||
git add .
|
||||
git commit -m"Deploy production js code for ${{ github.sha }}"
|
||||
git push
|
Loading…
Reference in New Issue
Block a user