Skip to content

Commit

Permalink
build ui
Browse files Browse the repository at this point in the history
  • Loading branch information
oplekal committed Dec 14, 2023
1 parent f9584f2 commit 0e05824
Showing 1 changed file with 80 additions and 77 deletions.
157 changes: 80 additions & 77 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,73 +7,24 @@ env:
ARTIFACT_NAME: eperusteet

jobs:
build-and-test-eperusteet-service:
build-and-test-eperusteet-ui:
runs-on: ubuntu-latest
env:
EPERUSTEET_SPECFILE: https://raw.githubusercontent.com/Opetushallitus/eperusteet/${{ github.ref_name }}/generated/eperusteet.spec.json
steps:
# - uses: actions/checkout@v3

# - name: workflow number debug
# run: echo "${{ github.run_id }} ${{ github.run_number }} ${{ github.run_attempt }}"

# - name: Set up JDK 11
# uses: actions/setup-java@v3
# with:
# java-version: '11'
# distribution: 'corretto'

# - name: Cache Maven repository
# uses: actions/cache@v3
# with:
# path: ~/.m2/repository
# key: ${{ runner.os }}-maven-cache-${{ hashFiles('**/pom.xml') }}
# restore-keys: |
# ${{ runner.os }}-maven-

# - name: Build with Maven
# run: |
# cd eperusteet/eperusteet-service
# mvn clean verify --batch-mode

# - name: Cache eperusteet-service build results
# uses: actions/cache@v3
# id: restore-service-build
# with:
# path: eperusteet/eperusteet-service/target
# key: ${{ github.run_number }}-${{ github.run_attempt }}-service
- name: Checkout source
uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
cache: 'maven'
- name: Build
run: |
cd eperusteet/eperusteet-service
mvn clean verify -B -DskipTests
- name: Upload eperusteet-service-jar
uses: actions/upload-artifact@v3
with:
name: eperusteet-service-jar
path: eperusteet/eperusteet-service/target/eperusteet-service.jar
# build-and-test-eperusteet-ui:
# runs-on: ubuntu-latest
# env:
# EPERUSTEET_SPECFILE: https://raw.githubusercontent.com/Opetushallitus/eperusteet/${{ github.ref_name }}/generated/eperusteet.spec.json
# steps:
# - uses: actions/checkout@v3

# - name: Set up JDK 11
# uses: actions/setup-java@v3
# with:
# java-version: '11'
# distribution: 'corretto'

# - name: Set up Node 10
# uses: actions/setup-node@v3
# with:
# node-version: '10'
- name: Set up Node 10
uses: actions/setup-node@v3
with:
node-version: '10'

# - name: Cache Maven repository
# uses: actions/cache@v3
Expand Down Expand Up @@ -129,33 +80,85 @@ jobs:
# echo branch not found
# fi

- name: Build with Maven
run: |
git clone ${{ env.EPERUSTEET_UI_GIT_BRANCH }} --recurse-submodules --depth 1 https://github.com/Opetushallitus/eperusteet-ui.git
export EPERUSTEET_SERVICE_DIR=${{ github.workspace }}/eperusteet/eperusteet-service
cd eperusteet-ui
yarn install --silent
cd eperusteet-frontend-utils/vue
yarn install --silent
yarn gen:api:eperusteet
rm -rf node_modules
cd ../..
echo "----------eperusteet-ui:n viimeisimman commitin sha----------"
git rev-parse HEAD
yarn run build
- name: Upload eperusteet-ui
uses: actions/upload-artifact@v3
with:
name: eperusteet-ui
path: eperusteet-ui/dist
build-and-test-eperusteet-service:
needs: [build-and-test-eperusteet-ui]
runs-on: ubuntu-latest
steps:
# - uses: actions/checkout@v3

# - name: workflow number debug
# run: echo "${{ github.run_id }} ${{ github.run_number }} ${{ github.run_attempt }}"

# - name: Set up JDK 11
# uses: actions/setup-java@v3
# with:
# java-version: '11'
# distribution: 'corretto'

# - name: Cache Maven repository
# uses: actions/cache@v3
# with:
# path: ~/.m2/repository
# key: ${{ runner.os }}-maven-cache-${{ hashFiles('**/pom.xml') }}
# restore-keys: |
# ${{ runner.os }}-maven-

# - name: Build with Maven
# run: |
# git clone ${{ env.EPERUSTEET_UI_GIT_BRANCH }} --recurse-submodules --depth 1 https://github.com/Opetushallitus/eperusteet-ui.git
# export EPERUSTEET_SERVICE_DIR=${{ github.workspace }}/eperusteet/eperusteet-service

# cd eperusteet-ui
# yarn install --silent
# cd eperusteet-frontend-utils/vue
# yarn install --silent
# yarn gen:api:eperusteet
# rm -rf node_modules
# cd ../..
# echo "----------eperusteet-ui:n viimeisimman commitin sha----------"
# git rev-parse HEAD
# yarn run build
# cp -R dist/ ../eperusteet/eperusteet-app/dist
# cd ..
# cd ${ARTIFACT_NAME}/eperusteet-app
# cd eperusteet/eperusteet-service
# mvn clean verify --batch-mode

# - name: Cache eperusteet-app build results
# - name: Cache eperusteet-service build results
# uses: actions/cache@v3
# id: restore-app-build
# id: restore-service-build
# with:
# path: eperusteet/eperusteet-app/target
# key: ${{ github.run_number }}-${{ github.run_attempt }}-app

# path: eperusteet/eperusteet-service/target
# key: ${{ github.run_number }}-${{ github.run_attempt }}-service
- name: Checkout source
uses: actions/checkout@v3
- name: Download eperusteet-ui
uses: actions/download-artifact@v3
with:
name: eperusteet-ui
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
cache: 'maven'
- name: Build
run: |
cp -R dist/ eperusteet/eperusteet-service/src/resources/static/ui
cd eperusteet/eperusteet-service/src/resources/static/ui
ls -latr
cd ../../../../../..
cd eperusteet/eperusteet-service
mvn clean verify -B -DskipTests
- name: Upload eperusteet-service-jar
uses: actions/upload-artifact@v3
with:
name: eperusteet-service-jar
path: eperusteet/eperusteet-service/target/eperusteet-service.jar
build-image:
needs: [build-and-test-eperusteet-service]
runs-on: ubuntu-latest
Expand Down

0 comments on commit 0e05824

Please sign in to comment.