Automated Image Updates (#17)

* Adds initial workflow file for automatically keeping container images up to date.
* TODO: Still requires testing for the cron schedule to ensure that it is working appropriately.
This commit is contained in:
Mike Keller
2021-02-23 11:53:18 -08:00
committed by GitHub
parent 614b07c1da
commit f52d09cf61
4 changed files with 93 additions and 0 deletions

31
.github/workflows/update-image.yml vendored Normal file
View File

@@ -0,0 +1,31 @@
name: "Update Image"
on:
# TODO: Remove faster schedule and pull_request once testing is completed.
schedule: # Schedled workflows only run once merged into main.
- cron: "*/5 * * * *" # Faster schedule for testing.
#- cron: "0 12 * * *" # Proposed schedule once testing has completed.
pull_request: # Here to ensure the workflow runs during testing. Will be removed once testing is completed.
types: [opened, reopened, synchronize]
jobs:
rebuild-container:
name: "Rebuild Container"
runs-on: ubuntu-latest
steps:
# Checkout the repo.
- name: "Checkout"
uses: "actions/checkout@v2"
# Build and push the repo.
- name: "Build and Push"
uses: docker/build-push-action@v1
with:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
registry: docker.pkg.github.com
repository: ${{ github.repository }}/simple-monerod
tags: latest
# TODO: Test that a release tag stays assigned to the rebuilt container when release tagged.
tag_with_ref: true
# TODO: Evaluate if the following are necessary.
add_git_labels: true
tag_with_sha: true