Skip to content

Commit 9bc6f26

Browse files
committed
Add checks
1 parent aed4fb0 commit 9bc6f26

File tree

11 files changed

+210
-102
lines changed

11 files changed

+210
-102
lines changed

.github/workflows/build.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Build
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- master
7+
- 'releases/*'
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-node@v4
15+
with:
16+
node-version: '22'
17+
cache: 'npm'
18+
- run: npm ci
19+
- run: npm run build
20+
- name: Check dist/ is up to date
21+
run: |
22+
if [ "$(git diff --name-only dist/)" != "" ]; then
23+
echo "dist/ is out of date. Run 'npm run build' and commit the result."
24+
git diff dist/
25+
exit 1
26+
fi

.github/workflows/prettier.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Prettier
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- master
7+
- 'releases/*'
8+
9+
jobs:
10+
prettier:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-node@v4
15+
with:
16+
node-version: '22'
17+
cache: 'npm'
18+
- run: npm ci
19+
- run: npm run format:check

.github/workflows/test.yaml

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: 'build-test'
1+
name: Test
22
on:
33
pull_request:
44
push:
@@ -7,31 +7,11 @@ on:
77
- 'releases/*'
88

99
jobs:
10-
build:
11-
runs-on: ubuntu-latest
12-
steps:
13-
- uses: actions/checkout@v4
14-
- uses: actions/setup-node@v4
15-
with:
16-
node-version: '22'
17-
cache: 'npm'
18-
- run: npm ci
19-
- run: npm run typecheck
20-
- run: npm run build
21-
- name: Check dist/ is up to date
22-
run: |
23-
if [ "$(git diff --name-only dist/)" != "" ]; then
24-
echo "dist/ is out of date. Run 'npm run build' and commit the result."
25-
git diff dist/
26-
exit 1
27-
fi
28-
2910
test:
30-
needs: build
3111
runs-on: ubuntu-latest
3212
steps:
3313
- uses: actions/checkout@v4
3414
- uses: ./
3515
with:
3616
dep: list
37-
deployer-version: "7.3.0"
17+
deployer-version: '7.3.0'

.github/workflows/typecheck.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Typecheck
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- master
7+
- 'releases/*'
8+
9+
jobs:
10+
typecheck:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-node@v4
15+
with:
16+
node-version: '22'
17+
cache: 'npm'
18+
- run: npm ci
19+
- run: npm run typecheck

.github/workflows/zizmor.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Zizmor
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- master
7+
- 'releases/*'
8+
9+
jobs:
10+
zizmor:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
security-events: write
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
persist-credentials: false
19+
- uses: woodruffw/zizmor-action@v2

.prettierignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dist/
2+
node_modules/
3+
package-lock.json

README.md

Lines changed: 72 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,83 @@
11
# GitHub Action for Deployer
22

33
```yaml
4-
- name: Deploy
5-
uses: deployphp/action@v1
6-
with:
7-
dep: deploy
8-
private-key: ${{ secrets.PRIVATE_KEY }}
4+
- name: Deploy
5+
uses: deployphp/action@v1
6+
with:
7+
dep: deploy
8+
private-key: ${{ secrets.PRIVATE_KEY }}
99
```
1010
1111
## Inputs
1212
1313
```yaml
14-
- name: Deploy
15-
uses: deployphp/action@v1
16-
with:
17-
# The deployer task to run. For example:
18-
# `deploy all`.
19-
# Required.
20-
dep: deploy
21-
22-
# The path to the PHP binary to use.
23-
# Optional.
24-
php-binary: "php"
25-
26-
# Specifies a sub directory within the repository to deploy
27-
# Optional
28-
sub-directory: "..."
29-
30-
# Config options for the Deployer. Same as the `-o` flag in the CLI.
31-
# Optional.
32-
options:
33-
keep_releases: 7
34-
35-
# Private key for connecting to remote hosts. To generate private key:
36-
# `ssh-keygen -o -t rsa -C 'action@deployer.org'`.
37-
# Optional.
38-
private-key: ${{ secrets.PRIVATE_KEY }}
39-
40-
# Content of `~/.ssh/known_hosts` file. The public SSH keys for a
41-
# host may be obtained using the utility `ssh-keyscan`.
42-
# For example: `ssh-keyscan deployer.org`.
43-
# If known-hosts omitted, `StrictHostKeyChecking no` will be added to
44-
# `ssh_config`.
45-
# Optional.
46-
known-hosts: |
47-
...
48-
49-
# The SSH configuration. Content of `~/.ssh/config` file.
50-
# Optional.
51-
ssh-config: |
52-
...
53-
54-
# Option to skip over the SSH setup/configuration.
55-
# Self-hosted runners don't need the SSH configuration or the SSH agent
56-
# to be started.
57-
# Optional.
58-
skip-ssh-setup: false
59-
60-
# Deployer version to download from deployer.org.
61-
# First, the action will check for Deployer binary at those paths:
62-
# - `vendor/bin/deployer.phar`
63-
# - `vendor/bin/dep`
64-
# - `deployer.phar`
65-
# If the binary not found, phar version will be downloaded from
66-
# deployer.org.
67-
# Optional.
68-
deployer-version: "7.0.0"
69-
70-
# You can specify path to your local Deployer binary in the repo.
71-
# Optional.
72-
deployer-binary: "bin/dep"
73-
74-
# You can choose to disable ANSI output.
75-
# Optional. Defaults to true.
76-
ansi: false
77-
78-
# You can specify the output verbosity level.
79-
# Optional. Defaults to -v.
80-
verbosity: -vvv
14+
- name: Deploy
15+
uses: deployphp/action@v1
16+
with:
17+
# The deployer task to run. For example:
18+
# `deploy all`.
19+
# Required.
20+
dep: deploy
21+
22+
# The path to the PHP binary to use.
23+
# Optional.
24+
php-binary: 'php'
25+
26+
# Specifies a sub directory within the repository to deploy
27+
# Optional
28+
sub-directory: '...'
29+
30+
# Config options for the Deployer. Same as the `-o` flag in the CLI.
31+
# Optional.
32+
options:
33+
keep_releases: 7
34+
35+
# Private key for connecting to remote hosts. To generate private key:
36+
# `ssh-keygen -o -t rsa -C 'action@deployer.org'`.
37+
# Optional.
38+
private-key: ${{ secrets.PRIVATE_KEY }}
39+
40+
# Content of `~/.ssh/known_hosts` file. The public SSH keys for a
41+
# host may be obtained using the utility `ssh-keyscan`.
42+
# For example: `ssh-keyscan deployer.org`.
43+
# If known-hosts omitted, `StrictHostKeyChecking no` will be added to
44+
# `ssh_config`.
45+
# Optional.
46+
known-hosts: |
47+
...
48+
49+
# The SSH configuration. Content of `~/.ssh/config` file.
50+
# Optional.
51+
ssh-config: |
52+
...
53+
54+
# Option to skip over the SSH setup/configuration.
55+
# Self-hosted runners don't need the SSH configuration or the SSH agent
56+
# to be started.
57+
# Optional.
58+
skip-ssh-setup: false
59+
60+
# Deployer version to download from deployer.org.
61+
# First, the action will check for Deployer binary at those paths:
62+
# - `vendor/bin/deployer.phar`
63+
# - `vendor/bin/dep`
64+
# - `deployer.phar`
65+
# If the binary not found, phar version will be downloaded from
66+
# deployer.org.
67+
# Optional.
68+
deployer-version: '7.0.0'
69+
70+
# You can specify path to your local Deployer binary in the repo.
71+
# Optional.
72+
deployer-binary: 'bin/dep'
73+
74+
# You can choose to disable ANSI output.
75+
# Optional. Defaults to true.
76+
ansi: false
77+
78+
# You can specify the output verbosity level.
79+
# Optional. Defaults to -v.
80+
verbosity: -vvv
8181
```
8282
8383
## Example

action.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@ name: 'deployphp/action'
33
description: 'Deploy with Deployer'
44

55
inputs:
6-
76
dep:
87
required: true
98
description: The command.
10-
9+
1110
php-binary:
1211
required: false
1312
default: ''

package-lock.json

Lines changed: 23 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,23 @@
66
},
77
"scripts": {
88
"build": "vite build",
9-
"typecheck": "tsc --noEmit"
9+
"typecheck": "tsc --noEmit",
10+
"format": "prettier --write .",
11+
"format:check": "prettier --check ."
1012
},
1113
"dependencies": {
1214
"@actions/core": "^3.0.0",
1315
"zx": "^8.8.5"
1416
},
1517
"devDependencies": {
1618
"@types/node": "^22.0.0",
19+
"prettier": "^3.8.1",
1720
"typescript": "^5.7.0",
1821
"vite": "^8.0.5"
22+
},
23+
"prettier": {
24+
"semi": false,
25+
"singleQuote": true,
26+
"endOfLine": "lf"
1927
}
2028
}

0 commit comments

Comments
 (0)