diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml new file mode 100644 index 00000000..0bb5b590 --- /dev/null +++ b/.github/workflows/ci-cd.yml @@ -0,0 +1,42 @@ +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":"mespapiers","beta":"mespapiers,publication","stable":"mespapiers,publication"}' + MATTERMOST_HOOK_URL: ${{ secrets.MATTERMOST_HOOK_URL }} + REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }} + +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: Set SSH for downcloud + uses: webfactory/ssh-agent@v0.9.0 + 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 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 163598c4..00000000 --- a/.travis.yml +++ /dev/null @@ -1,50 +0,0 @@ -dist: jammy -language: node_js -branches: - only: - - master - # tags - - /^\d+\.\d+\.\d+(\-beta.\d+)?$/ -env: - global: - - MATTERMOST_CHANNEL='{"dev":"app---mes-papiers","beta":"app---mes-papiers,publication","stable":"app---mes-papiers,publication"}' - # MATTERMOST_HOOK_URL - - secure: "M9AsiCREqvJIMNl79X+9WShz1KqBg3fuakfdOM4gu7lSGe5vdP5JvoCZdAgQSzuGmLv3uBG4qPb/5Zenf1alHPFQczwxJCove3sMdsRcc7TvvnexfP/UzTPsj/nFiEQ5ikIUI3yZcOWFce48SqvlLfgMtapeGrDvwixz1prcV7c0+D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qmk4GsTyegfc15SPKA5JCiDd+PYV70xPw2fnx9UvjXtF/mM4Jhy9ypGjsV7xCmFFeSqADqHcobglIEpH/edGv+FXygVKBHFIXnrBo6b73N4QDHIxhA34/8Js=" - # REGISTRY_TOKEN - - secure: "i8gUr4pLlB520lkFfiGlCSkm+wS0HtWuZFAEpQaeEoGope9ajlzDF5nU7zFVaOTFQKpWqljR6/y5pWIZ7VNxMxzFDZ6Hi0hi7HxeuGonJQXcnJ7TB5ViiCrfc04xR2T8BtTFmJkeV0MEYZ0AWkAEM9oD6AeweYoiCntWQS3c58VwgPf7jL5uT2LVGHH81Cqd4y9a/+Owtlvt05mpfI1o6gKJUo8tEG2B+fHWzXqU/CP0BKsRJxXY4vKwOJ3s83L3deeAxT7O//d/61es/6FgqUxQNfjlLhwsM7g7eGAR+5lUs5v57Qna2qh1wGdjcZBIFB+eaBb+YaE1eMxlo1OWK2qsTki9zWkjhUAwcEqoMKM4iMzS+MK+M1/DK07g6+2JpvuOo/17dcZHygYFXbHd4GJh8efido6xMuoCZaJIQHTQR2tgZI+QSj8QEGIA/3vaXxTw8mTTvewkQHzY20ER3rfn9WLXTUh6UutSj05SX6SMYZOkIntD6xtvWu9z/D5KnyOijAtn63U0hm/CxYoI5gXNYdX9wxTlLFAp8B88ESxa2vweuvbh8cwKNxmvgLBsnRN0UsfjRpIWYjHaGnGowaGrlDewzx+CbhJAL89+psCtwHlAXV5+/WKgITVgmcoNmCCrWyL856Ma+7RIL/kIXik2hNdbrLwUs6/bQtAiRUA=" -cache: - npm: false -jobs: - include: - - name: 'Lint' - script: yarn lint - - name: "Unit tests" - script: yarn test - - name: 'Build app' - script: - - yarn build - - yarn bundlemon - before_install: - - '[ "$TRAVIS_SECURE_ENV_VARS" != "false" ] && openssl aes-256-cbc -K $encrypted_fdd8b84f377d_key -iv $encrypted_fdd8b84f377d_iv -in id_rsa_downcloud_mespapiers.enc -out id_rsa_downcloud_mespapiers -d' - - '[ "$TRAVIS_SECURE_ENV_VARS" != "false" ] && eval "$(ssh-agent -s)"' - - '[ "$TRAVIS_SECURE_ENV_VARS" != "false" ] && chmod 600 id_rsa_downcloud_mespapiers' - - '[ "$TRAVIS_SECURE_ENV_VARS" != "false" ] && ssh-add id_rsa_downcloud_mespapiers' - before_deploy: - - yarn add cozy-app-publish # to be sure to have the last version before deploy - deploy: - - provider: script - repo: cozy/mespapiers - skip-cleanup: true - # deploy the build on a build branch and publish to the Cozy registry - script: yarn cozyPublish - on: - branch: master - - provider: script - repo: cozy/mespapiers - skip-cleanup: true - # publish stable or beta versions using Github Releases (git tag) - script: yarn cozyPublish - on: - tags: true diff --git a/id_rsa_downcloud_mespapiers.enc b/id_rsa_downcloud_mespapiers.enc deleted file mode 100644 index 4c1519a0..00000000 Binary files a/id_rsa_downcloud_mespapiers.enc and /dev/null differ