-
Notifications
You must be signed in to change notification settings - Fork 264
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrate front & api in github actions release process
- Loading branch information
1 parent
15905c8
commit 60135dd
Showing
1 changed file
with
38 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,17 +2,17 @@ name: Release CI | |
|
||
on: | ||
push: | ||
branches: [ master ] | ||
branches: [master] | ||
pull_request: | ||
branches: [ master ] | ||
branches: [master] | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Fetch tags | ||
uses: fnkr/[email protected] | ||
with: | ||
|
@@ -24,27 +24,42 @@ jobs: | |
uses: WyriHaximus/github-action-get-previous-tag@master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Cache SBT ivy cache | ||
|
||
- name: API - Cache SBT ivy cache | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.ivy2/cache | ||
key: ${{ runner.os }}-sbt-ivy-cache-${{ hashFiles('**/build.sbt') }} | ||
- name: Cache SBT | ||
- name: API - Cache SBT | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/.sbt | ||
key: ${{ runner.os }}-sbt-${{ hashFiles('**/build.sbt') }} | ||
- name: Set up JDK 1.8 | ||
- name: API - Set up JDK 1.8 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 1.8 | ||
- name: Run tests and generate release artifact | ||
run: cd server; sbt test it:test dist | ||
- name: rename dist file | ||
- name: API - Run tests and generate release artifact | ||
run: cd server; sbt test it:test dist | ||
- name: API - Rename artifact | ||
uses: canastro/copy-file-action@master | ||
with: | ||
source: server/target/universal/mocky-2020*.zip | ||
target: mocky-release.zip | ||
target: mocky-api-release.zip | ||
|
||
- name: CLIENT - Use Node.js | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: '12.x' | ||
- name: CLIENT - Install dependencies | ||
run: cd client; yarn --frozen-lockfile | ||
- name: CLIENT - Run tests | ||
run: cd client; yarn test | ||
- name: CLIENT - Build production app | ||
run: cd client; yarn build | ||
- name: CLIENT - Zip build folder | ||
run: zip -r mocky-front-release.zip client/build | ||
|
||
- name: Create Githbub Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
|
@@ -55,13 +70,23 @@ jobs: | |
release_name: Release ${{ steps.previoustag.outputs.tag }} | ||
draft: false | ||
prerelease: false | ||
- name: Upload release artifact in Github Release | ||
- name: Upload API release artifact in Github Release | ||
id: upload-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: mocky-api-release.zip | ||
asset_name: mocky-api-${{ steps.previoustag.outputs.tag }}.zip | ||
asset_content_type: application/zip | ||
- name: Upload CLIENT release artifact in Github Release | ||
id: upload-release-asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: mocky-release.zip | ||
asset_name: mocky-${{ steps.previoustag.outputs.tag }}.zip | ||
asset_path: mocky-front-release.zip | ||
asset_name: mocky-front-${{ steps.previoustag.outputs.tag }}.zip | ||
asset_content_type: application/zip |