Skip to content

Commit

Permalink
chore: add Upgrade GitHub workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentchalamon committed Oct 13, 2024
1 parent 02c8ce1 commit 9822820
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/upgrade.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# yaml-language-server: $schema=https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/github-workflow.json
name: Upgrade

on:
push:
branches:
- chore/release-workflow
workflow_dispatch: ~

jobs:
upgrade:
name: Upgrade
if: ${{ github.repository == 'api-platform/demo' }}
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Setup PHP with Composer
uses: shivammathur/setup-php@v2
with:
tools: composer
-
name: Get Composer Cache Directory
id: composer-cache
working-directory: api
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
-
name: Cache Dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
-
name: Install Dependencies
working-directory: api
run: composer install --prefer-dist
-
name: Update API Platform Dependencies
working-directory: api
run: composer update "api-platform/*"
-
name: Show git diff
working-directory: api
run: git diff
-
name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
branch: release/api-platform
commit-message: "chore: upgrade API Platform"
title: Upgrade API Platform
assignees: vincentchalamon
add-paths: |
api/composer.*

0 comments on commit 9822820

Please sign in to comment.