Merge pull request #156 from impresscms-dev/dependabot/github_actions… #4
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: Autoupdate code | |
| on: | |
| push: | |
| branches: | |
| - main | |
| concurrency: | |
| group: 'autobuild' | |
| cancel-in-progress: true | |
| permissions: | |
| contents: write | |
| jobs: | |
| prepare: | |
| name: Prepare | |
| runs-on: ubuntu-latest | |
| outputs: | |
| date: ${{ steps.date.outputs.date }} | |
| steps: | |
| - name: Get current date | |
| id: date | |
| run: echo "date=$(date -u +'%Y-%m-%d %H:%M UTC')" >> $GITHUB_OUTPUT | |
| update-and-commit: | |
| name: ${{ matrix.name }} and Commit | |
| needs: prepare | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - operation: format | |
| name: Format code | |
| description: "Format code according to project standards" | |
| - operation: pack | |
| name: Update dist folder | |
| description: "Rebuild the distribution files" | |
| max-parallel: 1 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| with: | |
| token: ${{ secrets.IMPRESSBOT_TOKEN }} | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '20' | |
| - name: Install dependencies | |
| run: npm install | |
| - name: Run ${{ matrix.operation }} | |
| run: npm run ${{ matrix.operation }} | |
| - name: Commit and push if changes exist | |
| uses: stefanzweifel/git-auto-commit-action@v7 | |
| with: | |
| commit_message: "${{ matrix.name }} ${{ needs.prepare.outputs.date }}" | |
| commit_user_name: ImpressBot | |
| commit_user_email: [email protected] | |
| commit_author: ImpressBot <[email protected]> |