HR-ATS-Portal/.gitea/workflows/deploy-to-s3.yml

95 lines
2.5 KiB
YAML

# name: Deploy to S3
# on:
# push:
# branches:
# - dev_main
# jobs:
# deploy:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout repository
# uses: actions/checkout@v3
# - name: Configure AWS credentials
# env:
# AWS_ACCESS_KEY_ID: ${{ secrets.DEVOPS_USER_AWS_ACCESS_KEY_ID }}
# AWS_SECRET_ACCESS_KEY: ${{ secrets.DEVOPS_USER_AWS_SECRET_ACCESS_KEY }}
# AWS_DEFAULT_REGION: us-east-1
# run: |
# echo "AWS credentials configured"
# - name: Archive project
# run: |
# apt-get update -y
# apt-get install -y zip
# zip -r utopia-ai-hr-ats-portal-dev.zip . \
# -x ".git/*" \
# -x ".gitea/*" \
# -x ".gitignore/*" \
# -x "*.DS_Store"
# - name: Install AWS CLI
# run: |
# apt-get update -y
# apt-get install -y curl unzip
# curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
# unzip -q awscliv2.zip
# ./aws/install
# aws --version
# - name: Upload files to S3
# env:
# AWS_ACCESS_KEY_ID: ${{ secrets.DEVOPS_USER_AWS_ACCESS_KEY_ID }}
# AWS_SECRET_ACCESS_KEY: ${{ secrets.DEVOPS_USER_AWS_SECRET_ACCESS_KEY }}
# AWS_DEFAULT_REGION: us-east-1
# run: |
# echo "Uploading repo contents to S3..."
# aws s3 cp utopia-ai-hr-ats-portal-dev.zip s3://utopia-ai-s3-bucket-2/utopia-ai-hr-ats-portal-dev.zip --region us-west-1
name: Deploy to S3
on:
push:
branches:
- dev_main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.DEVOPS_USER_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.DEVOPS_USER_AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1
- name: Archive and Upload to S3
run: |
zip -r utopia-ai-hr-ats-portal-dev.zip . \
-x ".git/*" \
-x ".gitea/*" \
-x ".gitignore" \
-x "*.DS_Store"
echo "Uploading archive to S3"
aws s3 cp utopia-ai-hr-ats-portal-dev.zip s3://utopia-ai-s3-bucket-2/utopia-ai-hr-ats-portal-dev.zip --region us-west-1