Skip to content

Commit

Permalink
Merge pull request #169 from pantheon-systems/update-actions
Browse files Browse the repository at this point in the history
Update GitHub Actions removing deprecated and adding dependabot
  • Loading branch information
stovak authored Jan 15, 2025
2 parents 0e0cf07 + 41c139d commit b224b9d
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 28 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
version: 2
updates:
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "daily"
open-pull-requests-limit: 10
commit-message:
prefix: "ci"
include: "scope"
labels:
- "dependencies"
- "github_actions"
reviewers:
- "dependabot"

# Maintain dependencies for Composer
- package-ecosystem: "composer"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
commit-message:
prefix: "composer"
include: "scope"
labels:
- "dependencies"
- "php"
versioning-strategy: "increase-if-necessary"
allow:
- dependency-type: "direct"
- dependency-type: "indirect"
42 changes: 14 additions & 28 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ jobs:
name: "Run validation test suite"
runs-on: ubuntu-latest
env:
# GITHUB_CONTEXT: ${{ toJson(github) }}
WP_CLI_BIN_DIR: /tmp/wp-cli-phar
DB_NAME: pantheon
DB_USER: pantheon
Expand Down Expand Up @@ -44,18 +43,18 @@ jobs:
- name: Get Composer Cache Directory
id: composer-cache
run: |
echo "::set-output name=dir::$(composer config cache-files-dir)"
echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT
- name: Cache Composer Downloads
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: |
${{ runner.os }}-composer-
- name: Cache PHP dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.OS }}-build-${{ hashFiles('**/composer.lock') }}
Expand All @@ -66,7 +65,6 @@ jobs:
- name: Install WP-CLI
run: |
# The Behat test suite will pick up the executable found in $WP_CLI_BIN_DIR
mkdir -p $WP_CLI_BIN_DIR
curl -s https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar > $WP_CLI_BIN_DIR/wp
chmod +x $WP_CLI_BIN_DIR/wp
Expand All @@ -80,22 +78,25 @@ jobs:
vendor/bin/behat --ansi
- name: Archive phar
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: wp-launch-check-phar
path: wp_launch_check.phar
retention-days: 5
if-no-files-found: error

deploy-packages:
name: Deploy
runs-on: ubuntu-latest
needs: [validate]
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Download Phar
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: wp-launch-check-phar

Expand All @@ -105,26 +106,11 @@ jobs:
with:
myToken: ${{ secrets.ACCESS_TOKEN }}

- name: Create Release
id: create_release
uses: actions/create-release@latest
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
body: |
${{ steps.changelog.outputs.changelog }}
token: ${{ secrets.ACCESS_TOKEN }}
body: ${{ steps.changelog.outputs.changelog }}
files: wp_launch_check.phar
draft: false
prerelease: false

- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./wp_launch_check.phar
asset_name: wp_launch_check.phar
asset_content_type: application/zip
prerelease: false

0 comments on commit b224b9d

Please sign in to comment.