Skip to content

.github/workflows/panel-create-user.yml #7

.github/workflows/panel-create-user.yml

.github/workflows/panel-create-user.yml #7

on:
workflow_dispatch:
inputs:
username:
description: 'Username'
required: true
type: string
first_name:
description: 'First name'
required: false
type: string
last_name:
description: 'Last name'
required: false
type: string
password:
description: 'Password'
required: true
type: string
email:
description: 'Email'
required: true
type: string
admin:
description: 'Is admin'
required: false
type: boolean
environment:
description: 'Environment'
type: environment
required: true
jobs:
create-user:
runs-on: ubuntu-latest
name: 'Create pterodactyl user'
defaults:
run:
working-directory: ./pterodactyl/panel
steps:
- uses: actions/checkout@v4
- uses: arwynfr/actions-docker-context@v2
with:
docker_host: 'ssh://${{ secrets.CODINGLABGG_SSH_USER }}@${{ secrets.CODINGLABGG_SSH_HOST }}'
context_name: 'prod-server'
ssh_key: ${{ secrets.CODINGLABGG_SSH_KEY }}
ssh_cert: ${{ secrets.CODINGLABGG_SSH_CERT }}
- name: '`docker compose run php artisan p:user:mak` on the production server'
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 == 'true' && 1 || 0 }} \
--name-first=${{ github.event.inputs.first_name }} \
--name-last=${{ github.event.inputs.last_name }}
env:
MYSQL_PASSWORD: ${{ secrets.MYSQL_PASSWORD }}
MYSQL_ROOT_PASSWORD: ${{ secrets.MYSQL_ROOT_PASSWORD }}