name: submelon.dev build on: push: branches: [ "trunk" ] jobs: build: runs-on: ubuntu-latest strategy: matrix: node-version: [18.x] steps: - uses: actions/checkout@v5 - name: Get changed files under src directory uses: dorny/paths-filter@v3 id: filter with: filters: | source: - 'src/**' - name: Get current date id: date run: echo "DATE_VERSION=$(date +'%s')" >> $GITHUB_OUTPUT - name: Modify version number if: steps.filter.outputs.source == 'true' uses: jacobtomlinson/gha-find-replace@v3 with: find: '"version": "[0-9]*"' replace: '"version": "${{ steps.date.outputs.DATE_VERSION }}"' include: 'config.json' - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v4 with: node-version: ${{ matrix.node-version }} cache: 'yarn' - name: Install Node.js packages run: yarn install --immutable --immutable-cache - name: Run Eleventy Build run: yarn build - name: Run post-build if: steps.filter.outputs.source == 'true' run: yarn post-build - name: Commit public changes uses: actions-js/push@master with: github_token: ${{ secrets.GITHUB_TOKEN }} branch: trunk