Skip to content

Commit

Permalink
added a cicd
Browse files Browse the repository at this point in the history
  • Loading branch information
sahi-oro committed Sep 6, 2024
1 parent 6a67c22 commit d37e7fd
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/s.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: S3 and Drive CI/CD Pipeline
on:
push:
branches:
- feat/drive-to-s3
jobs:
run-pipeline:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-south-1

- name: Rename folder in S3 to backup
run: |
aws s3 mv s3://isac-nitkkr-public/isaac-s3-images/ s3://isac-nitkkr-public/isaac-s3-images-bkp/ --recursive
env:
AWS_REGION: ap-south-1

- name: Install gdown to download from Google Drive
run: |
pip install gdown
- name: Download Google Drive folder
run: |
gdown --folder https://drive.google.com/drive/folders/1YLdE1YjT1qSU8ank-ZVhYs5cl0jQohS8
env:
AWS_REGION: ap-south-1

- name: Unzip downloaded files
run: |
sudo apt-get install unzip
unzip '*.zip' -d /tmp/unzipped-folder/
- name: Upload unzipped folder to S3
run: |
aws s3 cp /tmp/unzipped-folder/ s3://isac-nitkkr-public/isaac-s3-images/ --recursive
env:
AWS_REGION: ap-south-1

- name: Delete backup folder from S3 if all tasks pass
if: ${{ success() }}
run: |
aws s3 rm s3://isac-nitkkr-public/isaac-s3-images-bkp/ --recursive
env:
AWS_REGION: ap-south-1

0 comments on commit d37e7fd

Please sign in to comment.