Upload OneСlickInstall scripts on S3 #36
Workflow file for this run
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
name: Upload OneСlickInstall scripts on S3 | |
on: | |
workflow_dispatch: | |
inputs: | |
branch-buildtools: | |
description: 'Branch for buildtools repository' | |
required: true | |
default: 'develop' | |
env: | |
PRODUCT: ${{ github.event.repository.name }} | |
PRODUCT_LOW: echo ${{ github.event.repository.name }} | tr '[:upper:]' '[:lower:]' | |
BRANCH_BUILDTOOLS: ${{ github.event.inputs.branch-buildtools }} | |
jobs: | |
release: | |
name: Scripts release | |
runs-on: ubuntu-latest | |
env: | |
DOCKER_DIR: "$GITHUB_WORKSPACE/install/docker" | |
SCRIPT_DIR: "$GITHUB_WORKSPACE/install/OneClickInstall" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
repository: ONLYOFFICE/${{ env.PRODUCT }}-buildtools | |
ref: ${{ env.BRANCH_BUILDTOOLS }} | |
- name: Creating an enterprise script | |
run: | | |
cp ${{ env.SCRIPT_DIR }}/$(${{ env.PRODUCT_LOW }})-install.sh ${{ env.SCRIPT_DIR }}/$(${{ env.PRODUCT_LOW }})-enterprise-install.sh | |
sed -i 's/\(PARAMETERS -it\).*";/\1 ENTERPRISE";/' ${{ env.SCRIPT_DIR }}/$(${{ env.PRODUCT_LOW }})-enterprise-install.sh | |
- name: Create Docker Tarball | |
run: | | |
cd ${{ env.DOCKER_DIR }} | |
tar -czvf ${{ env.SCRIPT_DIR }}/docker.tar.gz --exclude='config/supervisor*' *.yml .env config/ | |
- name: Configure AWS Credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_OCI }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_OCI }} | |
aws-region: us-east-1 | |
- name: Upload scripts | |
run: | | |
cd ${{ env.SCRIPT_DIR }} | |
aws s3 cp . ${{ secrets.AWS_BUCKET_URL_OCI }}/ \ | |
--recursive \ | |
--acl public-read \ | |
--content-type application/x-sh \ | |
--metadata-directive REPLACE \ | |
--exclude '*' \ | |
--include="$(${{ env.PRODUCT_LOW }})-install.sh" \ | |
--include="$(${{ env.PRODUCT_LOW }})-enterprise-install.sh" \ | |
--include="install-RedHat.sh" \ | |
--include="install-RedHat/*" \ | |
--include="install-Debian.sh" \ | |
--include="install-Debian/*" \ | |
--include="install-Docker.sh" \ | |
--include="docker.tar.gz" | |
- name: Invalidate AWS CloudFront cache | |
run: | | |
aws cloudfront create-invalidation \ | |
--distribution-id ${{ secrets.AWS_DISTRIBUTION_ID_OCI }} \ | |
--paths \ | |
"/$(${{ env.PRODUCT_LOW }})-install.sh" \ | |
"/$(${{ env.PRODUCT_LOW }})-enterprise-install.sh" \ | |
"/install-RedHat.sh" \ | |
"/install-RedHat/*" \ | |
"/install-Debian.sh" \ | |
"/install-Debian/*" \ | |
"/install-Docker.sh" \ | |
"/docker.tar.gz" |