Skip to content

Commit

Permalink
Integrate front & api in github actions release process
Browse files Browse the repository at this point in the history
  • Loading branch information
julien-lafont committed Jun 7, 2020
1 parent 15905c8 commit 60135dd
Showing 1 changed file with 38 additions and 13 deletions.
51 changes: 38 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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

0 comments on commit 60135dd

Please sign in to comment.