Skip to content

Commit 4e8f235

Browse files
committed
ci: add create-user pipeline
1 parent 9e8b69a commit 4e8f235

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

.github/workflows/create-user.yml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
on:
2+
workflow_dispatch:
3+
inputs:
4+
username:
5+
description: 'Username'
6+
required: true
7+
type: string
8+
password:
9+
description: 'Password'
10+
required: true
11+
type: string
12+
email:
13+
description: 'Email'
14+
required: true
15+
type: string
16+
admin:
17+
description: 'Is admin'
18+
required: false
19+
type: boolean
20+
environment:
21+
description: 'Environment'
22+
type: environment
23+
required: true
24+
25+
jobs:
26+
create-user:
27+
runs-on: ubuntu-latest
28+
name: 'Create pterodactyl user'
29+
30+
steps:
31+
- uses: actions/checkout@v4
32+
33+
- uses: arwynfr/actions-docker-context@v2
34+
with:
35+
docker_host: 'ssh://${{ secrets.CODINGLABGG_SSH_USER }}@${{ secrets.CODINGLABGG_SSH_HOST }}'
36+
context_name: 'prod-server'
37+
ssh_key: ${{ secrets.CODINGLABGG_SSH_KEY }}
38+
ssh_cert: ${{ secrets.CODINGLABGG_SSH_CERT }}
39+
40+
- name: '`docker compose run php artisan p:user:mak` on the production server'
41+
working-directory: .
42+
run: docker --context prod-server compose run --rm panel php artisan p:user:make --username=${{ github.event.inputs.username }} --password=${{ github.event.inputs.password }} --email=${{ github.event.inputs.email }} --admin=${{ github.event.inputs.admin }} --name-first=Change --name-last=Me
43+
env:
44+
MYSQL_PASSWORD: ${{ secrets.MYSQL_PASSWORD }}
45+
MYSQL_ROOT_PASSWORD: ${{ secrets.MYSQL_ROOT_PASSWORD }}

0 commit comments

Comments
 (0)