Push AquilaCMS to S3 #82
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: Push AquilaCMS to S3 | |
on: | |
workflow_run: | |
workflows: ["Update AquilaCMS Version"] | |
types: | |
- completed | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [14.x] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v1 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Add new version in package.json | |
run: | | |
export packageFile=`cat package.json` | |
export versionLine=`cat package.json | grep "version"` | |
export versionLeft=${versionLine:14} | |
export currentAquilaVersion=${versionLeft::-2} | |
echo "Current version :" | |
echo $currentAquilaVersion | |
echo "currentAquilaVersion=$currentAquilaVersion" >> $GITHUB_ENV | |
- name: Prepare AquilaCMS for AWS S3 | |
run: | | |
export folderName="Aquila-${currentAquilaVersion}" | |
rm -rf .git | |
zip -r $folderName.zip . | |
mkdir tmp | |
mv $folderName.zip tmp/ | |
- name: Send Aquila on AWS S3 | |
uses: shallwefootball/s3-upload-action@master | |
with: | |
aws_key_id: ${{ secrets.AWS_KEY_ID }} | |
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}} | |
aws_bucket: ${{ secrets.AWS_AQL_BUCKET }} | |
destination_dir: '' | |
source_dir: 'tmp' | |
- name: Prepare version.txt | |
run: | | |
rm -rf tmp | |
echo "${currentAquilaVersion}" > version.txt | |
mkdir tmp | |
mv version.txt tmp/ | |
- name: Send version.txt on AWS S3 | |
uses: shallwefootball/s3-upload-action@master | |
with: | |
aws_key_id: ${{ secrets.AWS_KEY_ID }} | |
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}} | |
aws_bucket: ${{ secrets.AWS_AQL_BUCKET }} | |
destination_dir: '' | |
source_dir: 'tmp' |