DEV Community

Mark Tse
Mark Tse

Posted on • Edited on

1 1

Using GitHub Actions to Keep Another GitHub Action's Image Up-to-Date

My Workflow

gh-action-node-update-deps is a GitHub action for keeping dependencies up-to-date. Each time it runs, it installs the latest version of a few dependencies (Git, curl, hub). To improve performance, I created a custom Docker image with these dependencies already installed.

To keep this Docker image and all the installed dependencies up-to-date, I created a GitHub Actions workflow to schedule a recurring build of this image, which use a cron trigger and:

Submission Category:

DIY Deployments

Yaml File or Link to Code

name: Publish to Docker

on:
  schedule:
    - cron:  '0 * * * *'
  workflow_dispatch:

jobs:
  publish-to-docker:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v2
    - run: |
        git config user.name github-actions[bot]
        git config user.email 41898282+github-actions[bot]@users.noreply.github.com
        git commit --allow-empty -m "chore: update image (automated)."
        git push
    - uses: docker/build-push-action@v1
      with:
        username: neverendingqs
        password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
        repository: ${{ env.GITHUB_REPOSITORY }}
        add_git_labels: true
        tag_with_ref: true
        tag_with_sha: true

Additional Resources / Info

AWS Q Developer image

Your AI Code Assistant

Automate your code reviews. Catch bugs before your coworkers. Fix security issues in your code. Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Get started free in your IDE

Top comments (0)

Postmark Image

Speedy emails, satisfied customers

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay