diff --git a/.github/workflows/images-build-and-push.yaml b/.github/workflows/images-build-and-push.yaml index a34e991..2be8b1c 100644 --- a/.github/workflows/images-build-and-push.yaml +++ b/.github/workflows/images-build-and-push.yaml @@ -1,4 +1,4 @@ -name: Create and publish the container image. +name: Create and publish the container image on: push: diff --git a/.github/workflows/images-cleanup.yaml b/.github/workflows/images-cleanup.yaml index e943751..e692c41 100644 --- a/.github/workflows/images-cleanup.yaml +++ b/.github/workflows/images-cleanup.yaml @@ -8,7 +8,7 @@ permissions: packages: write env: - BASE_REPOSITORY: warmmetal/csi-driver-image + BASE_REPOSITORY: warm-metal/csi-driver-image jobs: clean-ghcr: diff --git a/.github/workflows/stale.yaml b/.github/workflows/stale.yaml new file mode 100644 index 0000000..45ac43a --- /dev/null +++ b/.github/workflows/stale.yaml @@ -0,0 +1,43 @@ +name: Close stale issues and PRs + +on: + push: + paths: + - .github/workflows/stale.yml + branches-ignore: + - dependabot/** + - releases/** + schedule: + # Once every day at midnight UTC. Source: https://crontab.guru/every-day + - cron: '0 0 * * *' + +permissions: + issues: write + pull-requests: write + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v9 + with: + # Setting this variable to 'true' will cause the + # action to run in a dry-run mode + debug-only: ${{ vars.DEBUG_ONLY == 'true' }} + stale-issue-message: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed in 7 days if no further activity occurs. + close-issue-message: > + Closing this issue after a prolonged period of inactivity. If this + issue is still present in the latest release, please feel free to + create a new issue with up-to-date information. + stale-pr-message: > + This pull request has been automatically marked as stale because it has not had + recent activity. It will be closed in 7 days if no further activity occurs. + close-pr-message: > + Closing this PR after a prolonged period of inactivity. Please create a new PR + if the changes of the PR are still relevant. + exempt-issue-labels: 'awaiting-approval,work-in-progress,help-wanted' + exempt-pr-labels: 'awaiting-approval,work-in-progress,help-wanted' + days-before-stale: 30 + days-before-close: 7 diff --git a/docs/automation.md b/docs/automation.md new file mode 100644 index 0000000..109bf95 --- /dev/null +++ b/docs/automation.md @@ -0,0 +1,28 @@ +# Automation + +There are a few [GitHub Workflows](https://docs.github.com/en/actions/using-workflows/about-workflows#about-workflows) that run on this repository. + +## Build +- [![Create and publish the container image.](https://github.com/warm-metal/csi-driver-image/actions/workflows/images-build-and-push.yaml/badge.svg)](https://github.com/warm-metal/csi-driver-image/actions/workflows/images-build-and-push.yaml) + - On the main repository - `warm-metal/csi-driver-image`, builds and pushes the container image to Docker Hub [`warmmetal/csi-image`](https://hub.docker.com/r/warmmetal/csi-image) + - On any forks, builds and pushes the container image to `ghcr.io/` + +## Tests + +- [![backward-compatibility-5mins](https://github.com/warm-metal/csi-driver-image/actions/workflows/backward-compatibility.yaml/badge.svg)](https://github.com/warm-metal/csi-driver-image/actions/workflows/backward-compatibility.yaml) +- [![containerd-11mins](https://github.com/warm-metal/csi-driver-image/actions/workflows/containerd.yaml/badge.svg)](https://github.com/warm-metal/csi-driver-image/actions/workflows/containerd.yaml) +- [![cri-o-10mins](https://github.com/warm-metal/csi-driver-image/actions/workflows/cri-o.yaml/badge.svg)](https://github.com/warm-metal/csi-driver-image/actions/workflows/cri-o.yaml) +- [![restart-ds-containerd-5mins](https://github.com/warm-metal/csi-driver-image/actions/workflows/restart-ds-containerd.yaml/badge.svg)](https://github.com/warm-metal/csi-driver-image/actions/workflows/restart-ds-containerd.yaml) +- [![restart-ds-crio-8mins](https://github.com/warm-metal/csi-driver-image/actions/workflows/restart-ds-crio.yaml/badge.svg)](https://github.com/warm-metal/csi-driver-image/actions/workflows/restart-ds-crio.yaml) +- [![test-metrics-5m](https://github.com/warm-metal/csi-driver-image/actions/workflows/metrics.yaml/badge.svg)](https://github.com/warm-metal/csi-driver-image/actions/workflows/metrics.yaml) + +## Maintenance + +- [![Delete old container images](https://github.com/warm-metal/csi-driver-image/actions/workflows/images-cleanup.yaml/badge.svg)](https://github.com/warm-metal/csi-driver-image/actions/workflows/images-cleanup.yaml) + - Deletes all `ghcr.io/` image tags, expect `latest` or any semver tags. This workflow will run on forks only. +- [![Close stale issues and PRs](https://github.com/warm-metal/csi-driver-image/actions/workflows/stale.yaml/badge.svg)](https://github.com/warm-metal/csi-driver-image/actions/workflows/stale.yaml) + - [Create a repository variable](https://docs.github.com/en/actions/learn-github-actions/variables#creating-configuration-variables-for-a-repository) `DEBUG_ONLY` with value `true` to run the action in dry-run mode. + - Marks issues or PRs as stale after 30 days and closes them after 7 days, except those labeled with any of of the following + - `awaiting-approval` + - `work-in-progress` + - `help-wanted`