schedule to update ssm documents #197
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: schedule to update ssm documents | |
on: | |
push: | |
schedule: | |
- cron: '0 0 * * 0' | |
jobs: | |
update-ssm-documents: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.11] | |
steps: | |
- name: Install dependencies | |
run: | | |
sudo apt install jq -y | |
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" | |
unzip awscliv2.zip | |
sudo ./aws/install --update | |
- name: Checkout codes | |
uses: actions/checkout@v1 | |
- 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: us-east-1 | |
- name: Update ssm documents | |
run: AWS_RETRY_MODE=standard AWS_MAX_ATTEMPTS=10 ./sync-documents.sh | |
- name: Commit updated files | |
run: | | |
git config --local user.email "davidzheng23@gmail.com" | |
git config --local user.name "Zheng Dayu" | |
git add . | |
git commit -m "Github actions auto update ssm documents" | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.ref }} | |