mirror of
https://github.com/vitodeploy/vito.git
synced 2025-04-19 09:51:37 +00:00
Fix run_action helper (#540)
* Fix run_action helper * upgrade actions * upgrade actions
This commit is contained in:
parent
5a12ed76bb
commit
babf59350b
6
.github/workflows/code-style.yml
vendored
6
.github/workflows/code-style.yml
vendored
@ -19,7 +19,7 @@ jobs:
|
|||||||
node-version: [ "20.x" ]
|
node-version: [ "20.x" ]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
@ -28,7 +28,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Cache Composer packages
|
- name: Cache Composer packages
|
||||||
id: composer-cache
|
id: composer-cache
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: vendor
|
path: vendor
|
||||||
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
|
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
|
||||||
@ -43,7 +43,7 @@ jobs:
|
|||||||
run: ./vendor/bin/pint --test
|
run: ./vendor/bin/pint --test
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v2
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: "20.x"
|
node-version: "20.x"
|
||||||
|
|
||||||
|
8
.github/workflows/docker-latest.yml
vendored
8
.github/workflows/docker-latest.yml
vendored
@ -11,16 +11,16 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v1
|
uses: docker/setup-qemu-action@v2
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v1
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
8
.github/workflows/docker-release.yml
vendored
8
.github/workflows/docker-release.yml
vendored
@ -10,16 +10,16 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v1
|
uses: docker/setup-qemu-action@v2
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v1
|
uses: docker/setup-buildx-action@v2
|
||||||
|
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
5
.github/workflows/tests.yml
vendored
5
.github/workflows/tests.yml
vendored
@ -18,7 +18,7 @@ jobs:
|
|||||||
php: [ 8.2 ]
|
php: [ 8.2 ]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup PHP
|
- name: Setup PHP
|
||||||
uses: shivammathur/setup-php@v2
|
uses: shivammathur/setup-php@v2
|
||||||
@ -27,12 +27,13 @@ jobs:
|
|||||||
|
|
||||||
- name: Cache Composer packages
|
- name: Cache Composer packages
|
||||||
id: composer-cache
|
id: composer-cache
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: vendor
|
path: vendor
|
||||||
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
|
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-php-
|
${{ runner.os }}-php-
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
if: steps.composer-cache.outputs.cache-hit != 'true'
|
if: steps.composer-cache.outputs.cache-hit != 'true'
|
||||||
run: composer install --prefer-dist --no-progress --no-suggest
|
run: composer install --prefer-dist --no-progress --no-suggest
|
||||||
|
@ -67,17 +67,19 @@ function run_action(object $static, Closure $callback): void
|
|||||||
try {
|
try {
|
||||||
$callback();
|
$callback();
|
||||||
} catch (SSHError $e) {
|
} catch (SSHError $e) {
|
||||||
|
$actions = [];
|
||||||
|
if ($e->getLog()) {
|
||||||
|
$actions[] = Action::make('View Logs')
|
||||||
|
->url(App\Web\Pages\Servers\Logs\Index::getUrl([
|
||||||
|
'server' => $e->getLog()->server_id,
|
||||||
|
]))
|
||||||
|
->openUrlInNewTab();
|
||||||
|
}
|
||||||
Notification::make()
|
Notification::make()
|
||||||
->danger()
|
->danger()
|
||||||
->title($e->getMessage())
|
->title($e->getMessage())
|
||||||
->body($e->getLog()?->getContent(30))
|
->body($e->getLog()?->getContent(30))
|
||||||
->actions([
|
->actions($actions)
|
||||||
Action::make('View Logs')
|
|
||||||
->url(App\Web\Pages\Servers\Logs\Index::getUrl([
|
|
||||||
'server' => $e->getLog()?->server_id,
|
|
||||||
]))
|
|
||||||
->openUrlInNewTab(),
|
|
||||||
])
|
|
||||||
->send();
|
->send();
|
||||||
|
|
||||||
if (method_exists($static, 'halt')) {
|
if (method_exists($static, 'halt')) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user