微修正 #3
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: glue-job | |
on: | |
pull_request: | |
branches: | |
- 'beta/**' | |
- 'PB/**' | |
paths: | |
- glue-job/** | |
push: | |
branches: | |
- 'feature/*' | |
- 'beta/*' | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout the repository | |
- uses: actions/checkout@v2 | |
# Set up AWS CLI | |
- name: Install AWS CLI | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y awscli | |
# Configure AWS credentials using GitHub secrets | |
- name: Configure AWS credentials | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.CODEBUILD_AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.CODEBUILD_AWS_SECRET_ACCESS_KEY }} | |
run: | | |
aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID | |
aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY | |
aws configure set region ap-northeast-1 | |
# Set WORKSPACE variable based on branch | |
- name: Set WORKSPACE variable | |
run: | | |
if [[ "${{ github.ref }}" == refs/heads/beta/* ]]; then | |
echo "WORKSPACE=beta" >> $GITHUB_ENV | |
elif [[ "${{ github.ref }}" == refs/heads/feature/* ]]; then | |
echo "WORKSPACE=e" >> $GITHUB_ENV | |
else | |
echo "WORKSPACE=hoge" >> $GITHUB_ENV | |
fi | |
# Remove job.py from S3 | |
- name: Remove job.py from S3 | |
run: | | |
aws s3 rm s3://touchgift-script-glue-staging-${{ env.WORKSPACE }}/job.py | |
# Upload new Python files to S3 | |
- name: Upload new Python files to S3 | |
run: | | |
aws s3 cp glue-job/baroque/staging/${{ env.WORKSPACE }}/evserver/job.py s3://touchgift-script-glue-staging-${{ env.WORKSPACE }}/job.py |