notify Telegram and publish a GitHub page #220
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: notify Telegram and publish a GitHub page | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 5 * * *' | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
concurrency: | |
group: "pages" | |
cancel-in-progress: true | |
jobs: | |
build: | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
name: run script | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out this repository | |
uses: actions/checkout@v2 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: '1.21.4' | |
cache-dependency-path: | | |
app/go.sum | |
- name: Build Go script | |
working-directory: ./app | |
run: go build . | |
- name: Run Go script | |
working-directory: ./app | |
run: go run . | |
env: | |
TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }} | |
TELEGRAM_TO: ${{ secrets.TELEGRAM_TO }} | |
OPEN_WHEATHER_API_KEY: ${{ secrets.OPEN_WHEATHER_API_KEY }} | |
EXCHANGERATE_API_KEY: ${{ secrets.EXCHANGERATE_API_KEY }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
REGION_NAME: ${{ secrets.REGION_NAME }} | |
OPENAI_ACCESS_KEY: ${{ secrets.OPENAI_ACCESS_KEY }} | |
OPENAI_ORGANIZATION: ${{ secrets.OPENAI_ORGANIZATION }} | |
APP_SCRIPT_ID: ${{ secrets.APP_SCRIPT_ID }} | |
- name: Setup Pages | |
uses: actions/configure-pages@v2 | |
- name: Upload artifact | |
uses: actions/upload-pages-artifact@v1 | |
with: | |
path: './app/www/' | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v1 |