Skip to content

fix: handle network errors #333

fix: handle network errors

fix: handle network errors #333

Workflow file for this run

name: Build and deploy (staging)
on:
push:
branches:
- "v2"
paths-ignore:
- 'docs/**'
- 'CHANGELOG.md'
- 'bin/**'
- 'infrastructure/**'
- '*.example'
- 'netlify.toml'
- '*.md'
jobs:
deploy:
runs-on: ubuntu-latest
environment: staging
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'npm'
- name: Assign env variables to a .env file
run: env | grep VUE_APP > .env.local
env:
VUE_APP_MATOMO_SITE_ID: 59
VUE_APP_API_ENDPOINT: "https://cartobio-preprod.agencebio.org/api"
VUE_APP_PRELOADED_CAMPAGNE_PAC: 2022
VUE_APP_ENVIRONMENT: staging
VUE_APP_SENTRY_DSN: ${{ secrets.VUE_APP_SENTRY_DSN }}
VUE_APP_GIT_COMMIT_SHA: ${{ github.sha }}
- run: npm clean-install-test
- run: |
npm run build:app
npm run build:widget -- --base "https://cartobio-preprod.agencebio.org/notification-webcomponent/"
npm run build:widget-demo -- --base "https://cartobio-preprod.agencebio.org/notification-webcomponent/"
- name: Install SSH Key
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.AGENCEBIO_SSH_PRIVATE_KEY }}
known_hosts: ${{ secrets.AGENCEBIO_SSH_KNOWN_HOSTS }}
- name: rsync
run: |
rsync -avzr --delete --exclude 'node_modules' --exclude '.git*' ./dist/ ${REMOTE_USER}@${REMOTE_HOST}:${REMOTE_PATH}
env:
REMOTE_HOST: ${{ secrets.AGENCEBIO_SSH_HOST }}
REMOTE_USER: ${{ secrets.AGENCEBIO_SSH_USERNAME }}
REMOTE_PATH: /var/www/cartobio-preprod.agencebio.org/
- id: version
run: echo v=$(node -p "require('./package.json').version") >> "$GITHUB_OUTPUT"
- name: Create Sentry staging release
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: betagouv
SENTRY_PROJECT: cartobio-front
SENTRY_URL: https://sentry.incubateur.net/
with:
environment: staging
sourcemaps: dist/assets/
# On a pas l'intégration GitHub qui permet que Sentry récupère dans
# l'autre sens les commits liés à la release, donc on skip
set_commits: skip
# Permet d'avoir le nom de la dernière release de prod
# dans le nom affiché sur Sentry tout en gardant un
# identifiant unique à ce commit
version: "${{ steps.version.outputs.v }}-dev-${{ github.sha }}"