Skip to content

Commit

Permalink
chore: Add CI with Github Actions
Browse files Browse the repository at this point in the history
And remove Travis
  • Loading branch information
Merkur39 committed Oct 16, 2024
1 parent b3f34f2 commit aa34f22
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 54 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: CI/CD

on:
pull_request:
push:
branches:
- master
tags:
- '[0-9]+.[0-9]+.[0-9]+'
- '[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+'

env:
MATTERMOST_CHANNEL: '{"dev":"contacts","beta":"contacts,publication","stable":"contacts,publication"}'
MATTERMOST_HOOK_URL: ${{ secrets.MATTERMOST_HOOK_URL }}
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
BUNDLEMON_PROJECT_ID: ${{ secrets.BUNDLEMON_PROJECT_ID }}

jobs:
build:
name: Build and publish
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Lint
run: yarn lint
- name: Test
run: yarn test
- name: Build
run: yarn build
- name: BundleMon
uses: lironer/bundlemon-action@v1
- name: Set SSH for downcloud
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.DOWNCLOUD_SSH_KEY }}
- name: Publish
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
run: yarn run cozyPublish --yes
50 changes: 0 additions & 50 deletions .travis.yml

This file was deleted.

2 changes: 0 additions & 2 deletions id_rsa_downcloud_contacts.enc

This file was deleted.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@
"build": "cozy-scripts build --browser --barV7 false",
"watch": "cozy-scripts watch --browser --barV7 false",
"start": "cozy-scripts start --browser --barV7 false",
"deploy": "cozy-app-publish --token $REGISTRY_TOKEN --build-dir 'build/' --prepublish downcloud --postpublish mattermost",
"cozyPublish": "cozy-app-publish --token $REGISTRY_TOKEN --build-dir 'build/' --prepublish downcloud --postpublish mattermost",
"test": "cozy-scripts test",
"stack:docker:dev": "docker run --rm -it -p 8080:8080 -p 5984:5984 -e COZY_DISABLE_CSP=1 -v \"$(pwd)/build\":/data/cozy-app/app cozy/cozy-app-dev",
"stack:docker:prod": "docker run --rm -it -p 8080:8080 -p 5984:5984 -v \"$(pwd)/build\":/data/cozy-app/app cozy/cozy-app-dev",
"cozyPublish": "git fetch origin ${DEPLOY_BRANCH:-build}:${DEPLOY_BRANCH:-build} && cozy-scripts publish --token $REGISTRY_TOKEN --build-commit $(git rev-parse ${DEPLOY_BRANCH:-build})",
"fixtures": "ACH import fixtures/contacts.json",
"fixtures:drop": "ACH drop io.cozy.contacts io.cozy.contacts.groups",
"fixtures:massive": "ACH import fixtures/massiveContacts.json",
Expand Down

0 comments on commit aa34f22

Please sign in to comment.