Merge pull request #82 from 4urcloud/dev #76
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: cicd | |
on: | |
push: | |
branches: | |
- main | |
- dev | |
jobs: | |
ci: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.head_ref }} # checkout the correct branch name | |
fetch-depth: 0 | |
- name: Setup Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 19 | |
- name: Installing dependencies | |
run: npm ci | |
- name: Run tests | |
run: npm run test | |
- name: Git Version | |
id: versioning | |
uses: codacy/[email protected] | |
with: | |
release-branch: main | |
dev-branch: dev | |
log-paths: Kexa/ | |
minor-identifier: 'feat:' | |
major-identifier: 'break:' | |
- name: Set up version in file | |
run: echo "${{ steps.versioning.outputs.version }}" > VERSION | |
- name: Run extract Addon | |
run: npm run update | |
- name: Get changed files | |
id: changed-files | |
uses: tj-actions/changed-files@v39 | |
- name: List all changed files | |
run: | | |
echo "## ${{ steps.versioning.outputs.version }}" >> CHANGELOG.md | |
echo "" >> CHANGELOG.md | |
echo "### Files added: ${{steps.changed-files.outputs.added_files_count}}" >> CHANGELOG.md | |
echo "" >> CHANGELOG.md | |
for file in ${{ steps.changed-files.outputs.added_files }}; do | |
echo "$file was added" >> CHANGELOG.md | |
echo "" >> CHANGELOG.md | |
done | |
echo "### Files changed: ${{steps.changed-files.outputs.all_changed_and_modified_files_count}}" >> CHANGELOG.md | |
echo "" >> CHANGELOG.md | |
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do | |
echo "$file was changed" >> CHANGELOG.md | |
echo "" >> CHANGELOG.md | |
done | |
echo "" >> CHANGELOG.md | |
- name: commit changes | |
uses: EndBug/add-and-commit@v4 | |
with: | |
author_name: estebanmathia | |
author_email: [email protected] | |
force: false | |
signoff: false | |
message: 'add info extract from addon' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
- name: Login to Docker Registry | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ secrets.DOCKER_REGISTRY_NAME}} | |
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }} | |
password: ${{ secrets.DOCKER_REGISTRY_PASSWORD }} | |
- name: Push on Docker Registry | |
uses: docker/build-push-action@v4 | |
with: | |
context: ./ | |
push: true | |
tags: | | |
${{ secrets.DOCKER_REGISTRY_NAME}}/innovtech/kexa:${{ steps.versioning.outputs.version }} | |
${{ secrets.DOCKER_REGISTRY_NAME}}/innovtech/kexa:latest | |
- name: Release | |
uses: ncipollo/release-action@v1 | |
with: | |
tag: "${{ steps.versioning.outputs.version }}" |