-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4e36086
commit 3c658f4
Showing
1 changed file
with
31 additions
and
30 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,36 @@ | ||
name: Schedule Python Script | ||
|
||
on: | ||
schedule: | ||
- cron: '0 16 * * *' | ||
- cron: '0 9 * * *' | ||
- cron: "0 16 * * *" | ||
jobs: | ||
run-script: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
# name: Schedule Python Script | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
# on: | ||
# schedule: | ||
# - cron: '0 16 * * *' | ||
# - cron: '0 9 * * *' | ||
# - cron: "0 16 * * *" | ||
# jobs: | ||
# run-script: | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v2 | ||
|
||
# - name: Set up Python | ||
# uses: actions/setup-python@v2 | ||
# with: | ||
# python-version: '3.x' | ||
|
||
- 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-northeast-2 | ||
# - 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-northeast-2 | ||
|
||
- name: create .env | ||
run: | | ||
touch .env | ||
echo ${{ secrets.EC2_SCHEDULER_ENV }} >> .env | ||
# - name: create .env | ||
# run: | | ||
# touch .env | ||
# echo ${{ secrets.EC2_SCHEDULER_ENV }} >> .env | ||
|
||
- name: Run Python script | ||
run: | | ||
pip install boto3 | ||
pip install dotenv | ||
python ./automation/pipeline_scripts/instance_on_off.py | ||
# - name: Run Python script | ||
# run: | | ||
# pip install boto3 | ||
# pip install dotenv | ||
# python ./automation/pipeline_scripts/instance_on_off.py |