feat(dd): hide polls #70
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: CI Workflow | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
prebuild: | |
name: Prebuild | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/master' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '21' | |
- name: Enable Corepack | |
run: corepack enable | |
- name: Cache Yarn | |
uses: actions/cache@v3 | |
with: | |
path: | | |
.yarn/ | |
yarn.lock.sha256sum | |
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} | |
- name: Install Dependencies | |
run: | | |
yarn install | |
- name: Build with sourcemaps | |
env: | |
REACT_APP_HTTP_PROTOCOL: ${{ vars.REACT_APP_HTTP_PROTOCOL }} | |
REACT_APP_API_URL: ${{ vars.REACT_APP_API_URL }} | |
REACT_APP_URL: ${{ vars.REACT_APP_URL }} | |
REACT_APP_WS_PROTOCOL: ${{ vars.REACT_APP_WS_PROTOCOL }} | |
CI: false | |
run: yarn run build_with_sourcemap | |
- name: Save git hash to version.txt | |
run: node get_git_hash.js > build/version.txt | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build | |
include-hidden-files: true | |
path: build/ | |
deploy-s3: | |
name: Deploy to S3 | |
runs-on: ubuntu-latest | |
needs: prebuild | |
if: github.ref == 'refs/heads/master' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Download Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: build | |
path: build | |
- name: Zip the build directory | |
run: | | |
cd build | |
find . -name "*.map" -type f -delete | |
zip -r app.zip . | |
cd ../ | |
- name: Set up AWS credentials | |
uses: aws-actions/configure-aws-credentials@v2 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: 'eu-west-3' # Update region if necessary | |
- name: Deploy to S3 | |
run: | | |
aws s3 rm s3://iseplife.fr --recursive | |
aws s3 cp build/ s3://iseplife.fr --recursive | |
deploy-datadog: | |
name: Deploy to Datadog | |
runs-on: ubuntu-latest | |
needs: prebuild | |
if: github.ref == 'refs/heads/master' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Download Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: build | |
path: build | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '21' | |
- name: Enable Corepack | |
run: corepack enable | |
- name: Cache Yarn | |
uses: actions/cache@v3 | |
with: | |
path: | | |
.yarn/ | |
yarn.lock.sha256sum | |
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }} | |
- name: Install Dependencies | |
run: | | |
echo "nodeLinker: node-modules" >> .yarnrc.yml | |
yarn install | |
- name: Upload to Datadog | |
env: | |
DATADOG_API_KEY: ${{ secrets.DATADOG_API_KEY }} | |
run: | | |
export DD_URL=$REACT_APP_URL/static/js | |
export DD_VERSION=$(yarn run version)-$(cat build/version.txt) | |
yarn run upload_datadog_sourcemaps | |