-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#1136] Moved Installer publishing to GHA. Part 2.
- Loading branch information
1 parent
cfb6b40
commit df07ac9
Showing
1 changed file
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# This action is used for DrevOps maintenance. It will not be used in the scaffolded project. | ||
name: Publish DrevOps installer | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
branches: | ||
- develop | ||
- '**installer**' | ||
|
||
jobs: | ||
drevops-publish-installer: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 8.1 | ||
|
||
- name: Install dependencies | ||
working-directory: .drevops/installer | ||
run: composer install | ||
|
||
- name: Add version | ||
working-directory: .drevops/installer | ||
run: | | ||
TAG=${{ github.ref_type == 'tag' && github.ref_name || '' }} | ||
SHA=${{ github.ref_type == 'branch' && github.sha || '' }} | ||
sed -i "s/\"git-tag-ci\": \"dev\"/\"git-tag-ci\": \"${TAG:-${SHA}}\"/g" box.json | ||
- name: Build installer | ||
working-directory: .drevops/installer | ||
run: composer build | ||
|
||
- name: Prepare artifact | ||
working-directory: .drevops/installer | ||
run: | | ||
mkdir -p /tmp/installer/docs | ||
cp .build/install.phar /tmp/installer/docs/index.html | ||
echo "install.drevops.com" > /tmp/installer/docs/CNAME | ||
- name: Setup SSH private key | ||
uses: webfactory/[email protected] | ||
with: | ||
ssh-private-key: ${{ secrets.INSTALLER_PUBLISH_SSH_PRIVATE_KEY }} | ||
|
||
- name: Publish installer | ||
run: | | ||
git config --global user.name "Deployment robot" | ||
git config --global user.email "[email protected]" | ||
cd /tmp/installer | ||
git init | ||
git checkout -b main | ||
git add -A | ||
git commit -m "Automatically pushed from drevops/drevops" | ||
git remote add origin [email protected]:drevops/installer.git | ||
git push origin main --force |