send-email-sunp #269
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: 'send-email-sunp' | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '30 10 * * *' | |
jobs: | |
test-update-file: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout files | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Update gmail_username | |
uses: fjogeleit/yaml-update-action@main | |
with: | |
valueFile: 'config-sunp.yml' | |
propertyPath: gmail.username | |
value: ${{ secrets.GMAIL_USERNAME }} | |
commitChange: false | |
- name: Update gmail_password | |
uses: fjogeleit/yaml-update-action@main | |
with: | |
valueFile: 'config-sunp.yml' | |
propertyPath: gmail.password | |
value: ${{ secrets.GMAIL_PASSWORD }} | |
commitChange: false | |
- name: Cat .yml | |
run: cat ${{ github.workspace }}/config-sunp.yml | |
- name: Update Last Run Date | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "GitHub Actions" | |
git pull | |
echo "SUNP Sent: $(date)" >> last-run.txt | |
git add last-run.txt | |
git commit -m "Update last run date" | |
git push | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Run send-email container | |
run: | | |
docker run --rm -v ${{ github.workspace }}:/root/flare/config --env CONFIG_FILE="/root/flare/config/config-sunp.yml" flareforecast/send-email:latest |