docker-hub #491
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: docker-hub | |
on: | |
push: | |
branches: main | |
schedule: | |
- cron: '1 */24 * * *' | |
jobs: | |
docker-hub: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
# Install requred packages | |
- name: Install apt packages | |
run: sudo apt-get install -y jq moreutils | |
# Checkout repository | |
- name: Checkout | |
uses: actions/checkout@v3 | |
# Login to Docker Hub | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
# Run script that checks for new versions and triggers builds | |
- name: Run build script | |
run: ./script.sh fetch --verbose | |
# Commit data.json file if changed detected | |
- name: Commit data.json metadata file | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: Update data.json file with new versions | |
branch: main | |
file_pattern: data.json |