Skip to content

test: run database tests in CI (#174) #162

test: run database tests in CI (#174)

test: run database tests in CI (#174) #162

Workflow file for this run

name: Continuous Integration
on:
push:
branches:
- main
tags:
- production*
- staging*
jobs:
lint-and-test:
uses: ./.github/workflows/lint-and-test.yml
version:
runs-on: ubuntu-latest
needs: lint-and-test
steps:
- name: πŸ›ŽοΈ Checkout
uses: actions/checkout@v3
- name: 🎫 Update patch version
run: |
git fetch
git checkout main
git pull origin main
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
if [[ $GITHUB_REF == refs/tags/production* ]]; then
npm version major
elif [[ $GITHUB_REF == refs/tags/staging* ]]; then
npm version minor
else
npm version patch
fi
git fetch --all
git push origin main
ci:
runs-on: ubuntu-latest
needs: version
steps:
- name: πŸ›ŽοΈ Checkout
uses: actions/checkout@v3
- run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
if [[ $GITHUB_REF == refs/tags/production* ]]; then
npm version major
elif [[ $GITHUB_REF == refs/tags/staging* ]]; then
npm version minor
else
npm version patch
fi
- name: πŸ“ Get Current Version
id: package-version
uses: martinbeentjes/npm-get-version-action@main
- name: πŸ” Login to Docker Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: πŸ”§ Build and push Docker Image
uses: docker/build-push-action@v4
with:
push: true
tags: |
ghcr.io/bostads-ab-mimer/onecore-leasing:${{ steps.package-version.outputs.current-version}}