Skip to content

Commit

Permalink
Update CI
Browse files Browse the repository at this point in the history
  • Loading branch information
hmiguim committed Dec 12, 2023
1 parent a7a452d commit 743a962
Showing 1 changed file with 31 additions and 12 deletions.
43 changes: 31 additions & 12 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,25 @@ on:
types: ["dispatch-main"]

jobs:
preprocessing:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Update package.json
run: |
cat package.json | jq ".version = \"$RELEASE_VERSION\"" | jq ".dbvtkVersion = \"$RELEASE_VERSION\"" > tmp
mv tmp package.json
env:
RELEASE_VERSION: ${{ github.event.client_payload.version }}
- name: Cache dist
uses: actions/cache/save@v3
with:
path: package.json
key: ${{ runner.os }}-${{ github.event.client_payload.version }}-package.json
build:
needs: preprocessing
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
Expand All @@ -14,29 +32,29 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '20.x'
- name: Update package.json
run: |
cat package.json | jq ".version = \"$RELEASE_VERSION\"" | jq ".dbvtkVersion = \"$RELEASE_VERSION\"" > tmp
mv tmp package.json
env:
RELEASE_VERSION: ${{ github.event.client_payload.version }}
- name: Cache dist
uses: actions/cache@v3
- name: Cache restore
uses: actions/cache/restore@v3
with:
path: dist/*
key: ${{ runner.os }}-${{ github.event.client_payload.version }}
path: package.json
key: ${{ runner.os }}-${{ github.event.client_payload.version }}-package.json
fail-on-cache-miss: true
- name: Package
run: yarn --link-duplicates --pure-lockfile && yarn dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DBPTK_UI_VERSION: ${{ github.event.client_payload.version }}
FLOW: ${{ github.event.client_payload.flow }}
RUNNER_OS: ${{ runner.os }}
- name: Cache restore
uses: actions/cache/save@v3
with:
path: dist/*
key: ${{ runner.os }}-${{ github.event.client_payload.version }}

deploy:
needs: [build]
Expand Down Expand Up @@ -76,6 +94,8 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set GitHub config
run: |
git config --local user.email "[email protected]"
Expand All @@ -85,7 +105,6 @@ jobs:
run: ./scripts/release.sh $TAG
env:
TAG: ${{ github.event.client_payload.version }}

- name: Push changes
uses: ad-m/github-push-action@master
with:
Expand Down

0 comments on commit 743a962

Please sign in to comment.