fix: Seperate workflows for releases and develop
This commit is contained in:
parent
af8d94530b
commit
997e5b9c48
2 changed files with 42 additions and 22 deletions
|
|
@ -3,9 +3,6 @@ name: Build and Publish Assets
|
|||
on:
|
||||
push:
|
||||
branches: [ develop ]
|
||||
release:
|
||||
types:
|
||||
- published
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
|
@ -34,7 +31,6 @@ jobs:
|
|||
tar -cvpzf $GITHUB_WORKSPACE/build/$GITHUB_SHA.tar.gz ./frappe-bench/sites/assets/js ./frappe-bench/sites/assets/css
|
||||
|
||||
- name: Publish assets to S3
|
||||
if: github.event == 'pull_request'
|
||||
uses: jakejarvis/s3-sync-action@master
|
||||
with:
|
||||
args: --acl public-read
|
||||
|
|
@ -45,21 +41,3 @@ jobs:
|
|||
AWS_S3_ENDPOINT: 'http://s3.fr-par.scw.cloud'
|
||||
AWS_REGION: 'fr-par'
|
||||
SOURCE_DIR: '$GITHUB_WORKSPACE/build'
|
||||
|
||||
- name: Attach Assets to Release
|
||||
if: github.event == 'release'
|
||||
uses: svenstaro/upload-release-action@v2
|
||||
with:
|
||||
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
file: $GITHUB_WORKSPACE/build/$GITHUB_SHA.tar.gz
|
||||
asset_name: assets.tar.gz
|
||||
tag: ${{ github.ref }}
|
||||
overwrite: true
|
||||
body: "Assets automatically generated which may be used to avoid re-building on local benches"
|
||||
|
||||
- name: Generate Action Artifacts
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: assets
|
||||
path: $GITHUB_WORKSPACE/build/$GITHUB_SHA.tar.gz
|
||||
42
.github/workflows/publish-assets-releases.yml
vendored
Normal file
42
.github/workflows/publish-assets-releases.yml
vendored
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
name: Build and Publish Assets built for releases
|
||||
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- created
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
path: 'frappe'
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
python-version: '12.x'
|
||||
- uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: '3.6'
|
||||
- name: Set up bench for current push
|
||||
run: |
|
||||
npm install -g yarn
|
||||
pip3 install -U frappe-bench
|
||||
bench init frappe-bench --no-procfile --no-backups --skip-assets --skip-redis-config-generation --python $(which python) --frappe-path $GITHUB_WORKSPACE/frappe
|
||||
cd frappe-bench && bench build
|
||||
|
||||
- name: Package assets
|
||||
run: |
|
||||
mkdir -p $GITHUB_WORKSPACE/build
|
||||
tar -cvpzf $GITHUB_WORKSPACE/build/$GITHUB_SHA.tar.gz ./frappe-bench/sites/assets/js ./frappe-bench/sites/assets/css
|
||||
|
||||
- name: Attach Assets to Release
|
||||
uses: svenstaro/upload-release-action@v2
|
||||
with:
|
||||
repo_token: ${{ secrets.GITHUB_ASSETS_TOKEN }}
|
||||
file: $GITHUB_WORKSPACE/build/$GITHUB_SHA.tar.gz
|
||||
asset_name: assets.tar.gz
|
||||
tag: ${{ github.ref }}
|
||||
overwrite: true
|
||||
body: "Assets automatically generated which may be used to avoid re-building on local benches"
|
||||
Loading…
Add table
Reference in a new issue