<commit_before>name: Build and Publish Assets built

on:
  push:
    branches: [ build-assets ] # for testing only
    # branches: [ develop ]

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2
        with:
          path: 'frappe'
      - uses: actions/setup-node@v1
        with:
          python-version: '12.x'
      - uses: actions/setup-python@v2
        with:
          python-version: '3.6'
      - name: Set up bench for current push
        run: |
          npm install -g yarn
          pip3 install -U frappe-bench
          bench init frappe-bench --no-procfile --no-backups --skip-assets --skip-redis-config-generation --python $(which python) --frappe-path $GITHUB_WORKSPACE/frappe
          cd frappe-bench && bench build

      - name: Package assets
        run: |
          cd frappe-bench/sites/assets
          tar -cvpzf $GITHUB_SHA.tar.gz /js /css

      - name: Publish assets
        uses: jakejarvis/s3-sync-action@master
        with:
          args: --acl public-read
        env:
          AWS_S3_BUCKET: 'frappe-assets'
          AWS_ACCESS_KEY_ID: ${{ secrets.S3_ASSETS_ACCESS_KEY_ID }}
          AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_ASSETS_SECRET_ACCESS_KEY }}
          AWS_S3_ENDPOINT: 'http://s3.fr-par.scw.cloud'
          AWS_REGION: 'fr-par'
          SOURCE_DIR: frappe-bench/sites/assets/$GITHUB_SHA.tar.gz

      - name: Generate Artifacts
        uses: actions/upload-artifact@v2
        with:
          name: $GITHUB_SHA.tar.gz
          path: frappe-bench/sites/assets/$GITHUB_SHA.tar.gz<commit_msg>fix: Use relative paths for tarring asset files<commit_after>name: Build and Publish Assets built

on:
  push:
    branches: [ build-assets ] # for testing only
    # branches: [ develop ]

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2
        with:
          path: 'frappe'
      - uses: actions/setup-node@v1
        with:
          python-version: '12.x'
      - uses: actions/setup-python@v2
        with:
          python-version: '3.6'
      - name: Set up bench for current push
        run: |
          npm install -g yarn
          pip3 install -U frappe-bench
          bench init frappe-bench --no-procfile --no-backups --skip-assets --skip-redis-config-generation --python $(which python) --frappe-path $GITHUB_WORKSPACE/frappe
          cd frappe-bench && bench build

      - name: Package assets
        run: |
          cd frappe-bench/sites/assets
          tar -cvpzf $GITHUB_SHA.tar.gz ./js ./css

      - name: Publish assets
        uses: jakejarvis/s3-sync-action@master
        with:
          args: --acl public-read
        env:
          AWS_S3_BUCKET: 'frappe-assets'
          AWS_ACCESS_KEY_ID: ${{ secrets.S3_ASSETS_ACCESS_KEY_ID }}
          AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_ASSETS_SECRET_ACCESS_KEY }}
          AWS_S3_ENDPOINT: 'http://s3.fr-par.scw.cloud'
          AWS_REGION: 'fr-par'
          SOURCE_DIR: frappe-bench/sites/assets/$GITHUB_SHA.tar.gz

      - name: Generate Artifacts
        uses: actions/upload-artifact@v2
        with:
          name: $GITHUB_SHA.tar.gz
          path: frappe-bench/sites/assets/$GITHUB_SHA.tar.gz
{'fraction_non_alphanumeric': 0.10774515927545285, 'fraction_numerical': 0.009369144284821987, 'mean_word_length': 1.9331501831501832, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7373596', 'n_tokens_mistral': 1086, 'n_tokens_neox': 1089, 'n_words': 226}