Update Docker images #42
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
# This action is used for DrevOps maintenance. It will not be used in the scaffolded project. | |
name: DrevOps - Publish 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 |