From 06847168107121e53bec82403f5e3ce33a4d95cd Mon Sep 17 00:00:00 2001 From: Maarten Bruna <14947039+ictbeheer@users.noreply.github.com> Date: Mon, 27 Jul 2026 11:56:29 +0200 Subject: [PATCH 1/5] feat: autodeploy action --- deploy/action.yml | 97 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 deploy/action.yml diff --git a/deploy/action.yml b/deploy/action.yml new file mode 100644 index 0000000..724ddf1 --- /dev/null +++ b/deploy/action.yml @@ -0,0 +1,97 @@ +name: Deploy +description: Deploys the application. +inputs: + github-token: + description: GitHub token for authentication. + required: true + op-service-account-token: + description: 1Password service account token. + required: true + selector: + description: The selector for deployer. + required: true + private-key: + description: The private key for SSH access. + required: true + ypackagist-api-key: + description: The API key for YPackagist. + required: true + ypackagist-password: + description: The password for YPackagist. + required: true + satis-username: + description: The username for Satis. + required: true + satis-password: + description: The password for Satis. + required: true + +# outputs: //TODO: how to get the output of the deploy command and pass it to the next step + + +runs: + using: "composite" + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Set up SSH + uses: webfactory/ssh-agent@v0.9.1 + with: + ssh-private-key: ${{ inputs.private-key }} + ssh-agent-cmd: /usr/bin/ssh-agent + + - name: Install PHP + uses: shivammathur/setup-php@v2 + with: + tools: composer:v2 + #TODO determine extensions needed for the project and deduplicate + github-token: ${{ inputs.github-token }} + env: + runner: self-hosted + COMPOSER_AUTH_JSON: | + { + "http-basic": { + "packagist.yard.nl": { + "username": "${{ inputs.ypackagist-api-key }}", + "password": "${{ inputs.ypackagist-password }}" + }, + "satis.yard.nl": { + "username": "${{ inputs.satis-username }}", + "password": "${{ inputs.satis-password }}" + } + } + } + + - name: Install composer dependencies + shell: bash + run: composer install --prefer-dist --no-interaction + + + - name: Install 1Password CLI + uses: 1password/install-cli-action@v4 + + - name: Install Node.js + uses: actions/setup-node@v3 + with: + node-version-file: '.nvmrc' + registry-url: 'https://npm.pkg.github.com' + scope: '@yardinternet' + + - uses: pnpm/action-setup@v6 + if: hashFiles('pnpm-lock.yaml') != '' + name: Install pnpm + with: + cache: true + + - name: Deploy + uses: deployphp/action@master + env: + OP_SERVICE_ACCOUNT_TOKEN: ${{ inputs.op-service-account-token }} + NODE_AUTH_TOKEN: ${{ inputs.github-token }} + with: + deployer-binary: vendor/bin/dep + dep: deploy ${{ inputs.selector }} + skip-ssh-setup: true From 6eb94f72c9fdc234ee3de122b986e0eedcb977e8 Mon Sep 17 00:00:00 2001 From: Roric van Schalkwijk Date: Wed, 2 Sep 2026 14:44:04 +0200 Subject: [PATCH 2/5] feat: if check for .nvmrc for openpdc/openpub --- deploy/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/deploy/action.yml b/deploy/action.yml index 724ddf1..af7d091 100644 --- a/deploy/action.yml +++ b/deploy/action.yml @@ -74,6 +74,7 @@ runs: uses: 1password/install-cli-action@v4 - name: Install Node.js + if: hashFiles('.nvmrc') != '' uses: actions/setup-node@v3 with: node-version-file: '.nvmrc' From c52bc25d963ea097a535ed15c4c0f4367fa56aff Mon Sep 17 00:00:00 2001 From: Roric van Schalkwijk Date: Thu, 3 Sep 2026 15:41:31 +0200 Subject: [PATCH 3/5] feat: add token as env value --- deploy/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/deploy/action.yml b/deploy/action.yml index af7d091..cd9bc05 100644 --- a/deploy/action.yml +++ b/deploy/action.yml @@ -92,6 +92,7 @@ runs: env: OP_SERVICE_ACCOUNT_TOKEN: ${{ inputs.op-service-account-token }} NODE_AUTH_TOKEN: ${{ inputs.github-token }} + GITHUB_TOKEN: ${{ inputs.github-token }} with: deployer-binary: vendor/bin/dep dep: deploy ${{ inputs.selector }} From 371a7b28cba77ddc389e13f732b537d1337f6a9e Mon Sep 17 00:00:00 2001 From: Roric van Schalkwijk Date: Thu, 3 Sep 2026 17:28:09 +0200 Subject: [PATCH 4/5] feat: set known hosts file --- deploy/action.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/deploy/action.yml b/deploy/action.yml index cd9bc05..634a91e 100644 --- a/deploy/action.yml +++ b/deploy/action.yml @@ -25,9 +25,10 @@ inputs: satis-password: description: The password for Satis. required: true + known-hosts: + description: SSH known_hosts entries for the deploy targets. + required: true -# outputs: //TODO: how to get the output of the deploy command and pass it to the next step - runs: using: "composite" @@ -43,6 +44,10 @@ runs: ssh-private-key: ${{ inputs.private-key }} ssh-agent-cmd: /usr/bin/ssh-agent + - name: Set known_hosts + shell: bash + run: echo "${{ inputs.known-hosts }}" > ~/.ssh/known_hosts + - name: Install PHP uses: shivammathur/setup-php@v2 with: From e178deb12b0bed2177dd4032678ace654bd395a9 Mon Sep 17 00:00:00 2001 From: Roric van Schalkwijk Date: Thu, 3 Sep 2026 17:41:43 +0200 Subject: [PATCH 5/5] chore: change composer auth json to single input --- deploy/action.yml | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/deploy/action.yml b/deploy/action.yml index 634a91e..b7927f6 100644 --- a/deploy/action.yml +++ b/deploy/action.yml @@ -13,17 +13,8 @@ inputs: private-key: description: The private key for SSH access. required: true - ypackagist-api-key: - description: The API key for YPackagist. - required: true - ypackagist-password: - description: The password for YPackagist. - required: true - satis-username: - description: The username for Satis. - required: true - satis-password: - description: The password for Satis. + composer-auth-json: + description: full composer auth json required: true known-hosts: description: SSH known_hosts entries for the deploy targets. @@ -56,20 +47,7 @@ runs: github-token: ${{ inputs.github-token }} env: runner: self-hosted - COMPOSER_AUTH_JSON: | - { - "http-basic": { - "packagist.yard.nl": { - "username": "${{ inputs.ypackagist-api-key }}", - "password": "${{ inputs.ypackagist-password }}" - }, - "satis.yard.nl": { - "username": "${{ inputs.satis-username }}", - "password": "${{ inputs.satis-password }}" - } - } - } - + COMPOSER_AUTH_JSON: ${{ inputs.composer-auth-json }} - name: Install composer dependencies shell: bash run: composer install --prefer-dist --no-interaction