Add tota11yscan step in workflow #63
This file contains hidden or 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: Publish website | ||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| jobs: | ||
| build_and_deploy: | ||
| name: Build & deploy website | ||
| runs-on: ubuntu-latest | ||
| if: github.repository == 'Orange-OpenSource/Tota11ylost' | ||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v2 | ||
| - name: Generate firebaseConfig.js | ||
| run: | | ||
| echo "window.env = {" > ./src/firebaseConfig.js | ||
| echo " FIREBASE_API_KEY: '${{ secrets.FIREBASE_API_KEY }}'," >> ./src/firebaseConfig.js | ||
| echo " FIREBASE_AUTH_DOMAIN: '${{ secrets.FIREBASE_AUTH_DOMAIN }}'," >> ./src/firebaseConfig.js | ||
| echo " FIREBASE_PROJECT_ID: '${{ secrets.FIREBASE_PROJECT_ID }}'," >> ./src/firebaseConfig.js | ||
| echo " FIREBASE_STORAGE_BUCKET: '${{ secrets.FIREBASE_STORAGE_BUCKET }}'," >> ./src/firebaseConfig.js | ||
| echo " FIREBASE_MESSAGING_SENDER_ID: '${{ secrets.FIREBASE_MESSAGING_SENDER_ID }}'," >> ./src/firebaseConfig.js | ||
| echo " FIREBASE_APP_ID: '${{ secrets.FIREBASE_APP_ID }}'," >> ./src/firebaseConfig.js | ||
| echo " FIREBASE_MEASUREMENT_ID: '${{ secrets.FIREBASE_MEASUREMENT_ID }}'" >> ./src/firebaseConfig.js | ||
| echo "};" >> ./src/firebaseConfig.js | ||
| - name: Deploy to GitHub Pages | ||
| uses: peaceiris/actions-gh-pages@v3.6.4 | ||
| with: | ||
| github_token: ${{ secrets.GITHUB_TOKEN }} | ||
| publish_dir: ./src | ||
| cname: tota11ylost.orange.com | ||
| wait_for_deployment: | ||
| name: Wait for deployed website | ||
| needs: build_and_deploy | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Wait for GitHub Pages | ||
| run: | | ||
| set -eu | ||
| for attempt in $(seq 1 30); do | ||
| if curl \ | ||
| --fail \ | ||
| --silent \ | ||
| --show-error \ | ||
| --output /dev/null \ | ||
| "https://tota11ylost.orange.com"; then | ||
| echo "Website is reachable." | ||
| exit 0 | ||
| fi | ||
| echo "Website not ready yet: attempt ${attempt}/30" | ||
| sleep 10 | ||
| done | ||
| echo "Website did not become reachable before timeout." | ||
| exit 1 | ||
| accessibility: | ||
| name: Accessibility scan | ||
| needs: wait_for_deployment | ||
| uses: Orange-OpenSource/tota11y-scan/.github/workflows/tota11y-scan-reusable.yml@v1.0.46 | ||
| with: | ||
| scanner_repository: "Orange-OpenSource/tota11y-scan" | ||
| scanner_ref: "v1.0.46" | ||
| engine_package_version: "1.0.45" | ||
| test_type: "essentials" | ||
| target: "web" | ||
| urls: "https://tota11ylost.orange.com" | ||
| allow_failure: true | ||
| artifact_retention_days: 30 | ||
| secrets: | ||
| npm_token: ${{ secrets.TOTA11Y_NPM_TOKEN }} | ||