Skip to content

Scheduled Container Run #121

Scheduled Container Run

Scheduled Container Run #121

Workflow file for this run

name: Scheduled Container Run
on:
schedule:
- cron: '0 * * * *' # Run every hour
workflow_dispatch: # Allow manual triggers
permissions:
contents: read
packages: read
jobs:
run-container:
runs-on: ubuntu-latest
timeout-minutes: 1
steps:
- name: Login to GitHub Container Registry
uses: docker/#-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pull and run container
run: |
REPO=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
docker pull ghcr.io/${REPO}:latest
docker run --rm \
-e WEATHERAPICOM_API_KEY="${{ secrets.WEATHERAPICOM_API_KEY }}" \
-e LAT="${{ secrets.LAT }}" \
-e LON="${{ secrets.LON }}" \
-e GITHUB_TOKEN="${{ secrets.GH_PAT }}" \
ghcr.io/${REPO}:latest