Skip to content

Merge pull request #6 from openjournalteam/5-icon-tidak-dapat-terload… #27

Merge pull request #6 from openjournalteam/5-icon-tidak-dapat-terload…

Merge pull request #6 from openjournalteam/5-icon-tidak-dapat-terload… #27

Workflow file for this run

name: SyncToS3-IDrive
# Controls when the action will run.
on:
push:
branches:
- 34
- 33
- 32
- 31
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# https://github.com/marketplace/actions/s3-sync
steps:
- uses: actions/checkout@master
- name: Retrieve JSON File
id: json_properties
uses: zoexx/github-action-json-file-properties@release
with:
file_path: "./.github/package.json"
- name: Retrieve S3 JSON File
id: s3_key
uses: zoexx/github-action-json-file-properties@release
with:
file_path: "./.github/s3.json"
- name: Get branch name
id: branch-name
uses: tj-actions/branch-name@v6
- name: Set all variable used
run: |
echo "UPLOAD_FOLDER=${{steps.json_properties.outputs.platform}}/${{steps.json_properties.outputs.product_category}}/${{steps.json_properties.outputs.name}}/${{ steps.branch-name.outputs.current_branch }}" >> $GITHUB_ENV
echo "REPO_NAME=${{steps.json_properties.outputs.name}}" >> $GITHUB_ENV
- name: Create folder and removing .git and .github dir
run: |
mkdir ./academic_free
mkdir ./zipped
rsync -a ./ ./academic_free/$REPO_NAME
rm -rf ./academic_free/$REPO_NAME/.git*
rm -rf ./academic_free/$REPO_NAME/academic_free
- name: Zip the repo and Pack to S3_Upload folder before uploading
uses: vimtor/action-zip@v1
with:
files: ./academic_free
dest: ./zipped/${{steps.json_properties.outputs.name}}.zip
# Copy the version.xml file to the zipped folder
- name: Copy the version.xml file
run: |
cp ./academic_free/academic_free/version.xml ./zipped/version.xml
#everthing is working now, then upload
- name: Upload Zip File to S3 Folder ( Version )
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks --delete --include '*' --exclude './.git/*' --exclude './.github/*' --exclude './.vscode/*' --exclude '.gitignore' --exclude './academic_free/*' --exclude './.gitmodules'
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ steps.s3_key.outputs.region }}
AWS_S3_ENDPOINT: ${{ steps.s3_key.outputs.endpoint }}
AWS_S3_BUCKET: ${{ steps.s3_key.outputs.bucket }}
SOURCE_DIR: "./zipped/"
DEST_DIR: "/$UPLOAD_FOLDER/"