diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml new file mode 100644 index 0000000000..9393237947 --- /dev/null +++ b/.github/workflows/ci-cd.yml @@ -0,0 +1,50 @@ +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":"gangsters","beta":"gangsters,publication","stable":"gangsters,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 & Quality checks + run: | + yarn lint + yarn check-locales + yarn check-fixtures + - name: Test + run: yarn test --runInBand + - name: Build + run: yarn build + - name: BundleMon + uses: lironer/bundlemon-action@v1 + - 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 + yarn uploadStaticFiles diff --git a/.travis.yml b/.travis.yml deleted file mode 100755 index fa0778715b..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,48 +0,0 @@ -language: node_js -node_js: 20 -dist: jammy -cache: - npm: false -branches: - only: - - master - # detect also tag like x.y.z or x.y.z-beta.n as travis consider them to be branches - - /^\d+\.\d+\.\d+(\-beta.\d+)?$/ -env: - global: - - MATTERMOST_CHANNEL='{"dev":"gangsters","beta":"gangsters,publication","stable":"gangsters,publication"}' - # cozy-bot GH_TOKEN - # to generate yours : travis encrypt G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ee7mtF2YGndiO8NCISCORe3fi/gh19SOB4je8+g/CVWYU6tz7D5Ci5UKBMglnPP1o/TsO2J7VEbs9HqwfsBxghLo988KDeqtIaXCLY3Buro29jGgbYLcT9h7qG/Q3F1b4Z5Dga4FzPUQ4D11yXbv1pip1UNTwTWzyyY5YemIr0M7c4Z6JrndrrNact/iIUOW3rBoXVuWnltHfmVyXIfognBDGiB4YUHDdhSZd4etIQxID9cbEfdsL2xycrpH2bdqX9ePYK+DahBmx+qUESVpcMvW4cTYJygIY=" - # ENCRYPTED_IV - - secure: "iz1NO2t2ZSEpc7CMz2CtMNXyFa4FTLRZu9wPlnx1IwXHTworqJ8ENSAv4kDHOFYWXubHb52c2c3dMMLLZtHxRpTtnHRvEDCHzLdc6RP5wnoOLogtfSzD140g94+iPEaXfg6hJ/Wv1nE+iBTtfDTpRMy8e/i+InU4af3FcwqMJW1oroslgd9ubZV+KUuv4nHZNOxTW67lLUQ2iRI3b7Ewjo/zkhMgCGLz4lnSO6KnspgKQ6VUA+UeV+Xx28Y5mDpH2ouhfajji6xUHptoB9AG2WZf6GfpOOMB5gxSnGNf6BiVal/TyG0unMiUy6dij+6XYnSpmG6EWna7nR35M4PD7pIwiOzcvwVwvZ4j5GnXIoIOA12Wd9vP8iPmji509slgsut00qFbgU4Uxii8ElGuDdChGzdVXuSYUBLtX7ldMcYKLMckyn/wBnWndQrDNv5jDROms+8YxNIFbm4kRM3ynt1xMFtm2v43Cj/VQ+ZwFV0cr3Y6y4QoThBrnuFXHIXJfe8HsuYZaGPpa9Jf1SDRNut7ClmvGm5+Yf+gkG1Csm82perZ1SQBtyBdtEPF71zQ1ktWYduQrG6jLb4On5zcGZ+CmPdjOopNatq6AatpFYpuZkVyhTbyn626fRIOCgbyDkgSS6yBweUB5eq8EW7Fdu8jqB0fR5+WKISe7m6dpTg=" -jobs: - include: - - name: "Quality checks" - script: yarn lint && yarn check-locales && yarn check-fixtures - - name: "Unit tests" - script: yarn test --runInBand - - name: "Build app" - script: - - yarn build - - yarn bundlemon - before_deploy: ./scripts/ci/add_ssh_key.sh - deploy: - - &deploy - provider: script - repo: cozy/cozy-banks - skip-cleanup: true - script: yarn cozyPublish && yarn uploadStaticFiles - on: - branch: master - - <<: *deploy - on: - tags: true