EGON-45: Test split jobs in workflow #61
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
name: Continuous integration | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
dependencies: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 16 | |
- name: Load cache | |
uses: actions/cache/restore@v3 | |
with: | |
path: | | |
node_modules | |
key: node_modules | |
- name: Install latest updates | |
run: npm ci | |
- name: Save cache | |
uses: actions/cache/save@v3 | |
with: | |
path: | | |
node_modules | |
key: node_modules | |
test: | |
runs-on: ubuntu-latest | |
needs: dependencies | |
steps: | |
- name: Run tests | |
run: npm run test | |
# build: | |
# | |
# runs-on: ubuntu-latest | |
# | |
# permissions: | |
# contents: read | |
# packages: write | |
# | |
# steps: | |
# - uses: actions/checkout@v4 | |
# - uses: actions/setup-node@v4 | |
# with: | |
# node-version: 16 | |
# - run: npm ci | |
# - run: npm run format:check | |
# - run: npm run test | |
# - run: npm run build | |
# - run: npm run zip | |
# | |
# - uses: actions/upload-artifact@v3 | |
# with: | |
# name: domain-story-modeler | |
# path: | | |
# dist/*.zip | |
# README.md | |
# if-no-files-found: error # 'warn' or 'ignore' are also available, defaults to `warn` | |
# | |
# - name: Deploy website | |
# run: | | |
# sed -i -E "s/version:\s'[0-9]+\.[0-9]+\.[0-9]+'/version: '${{ github.sha }}'/" src/environments/environment.prod.ts | |
# sed -i -E "s/\"version\":\s\"[0-9]+\.[0-9]+\.[0-9]+\"/\"version\": \"${{ github.sha }}\"/" package.json | |
# npm run build | |
# | |
# CLONE_DIR=$(mktemp -d) | |
# | |
# git config --global user.email "[email protected]" | |
# git config --global user.name "Egon.io Bot" | |
# git clone --single-branch --branch main "https://x-access-token:${{ secrets.EGON_IO_DEPLOYMENT_PAT }}@github.com/WPS/egon.io-website.git" "${CLONE_DIR}" | |
# | |
# rm -r "${CLONE_DIR}/app-latest" | |
# mkdir "${CLONE_DIR}/app-latest" | |
# cp -r dist_build/egon/* "${CLONE_DIR}/app-latest" | |
# | |
# cd "${CLONE_DIR}" | |
# git add . | |
# git commit -m "Deploy latest build" | |
# git push | |
# | |
# - name: Log in to the Container registry | |
# uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 | |
# with: | |
# registry: ghcr.io | |
# username: ${{ github.actor }} | |
# password: ${{ secrets.GITHUB_TOKEN }} | |
# | |
# - name: Build and push Docker image | |
# uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 | |
# with: | |
# context: . | |
# push: true | |
# tags: latest |