Weekly Release #14
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: Weekly Release | |
on: | |
schedule: | |
# If the schedule stops working, see the docs: https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/events-that-trigger-workflows#schedule | |
- cron: '0 0 * * 0' # Runs weekly at 00:00 on Sunday | |
workflow_dispatch: # Allows manual triggering | |
env: | |
REGISTRY: ghcr.io | |
REPOSITORY: ${{ github.repository }} | |
VERSION: "" | |
TAG_MAJOR: "" | |
TAG_MINOR: "" | |
TAG_PATCH: "" | |
TAG_LATEST: "" | |
TAG_OLD: "" | |
permissions: | |
contents: read | |
jobs: | |
release-build-and-push: | |
name: Weekly Release Build and Push | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
packages: write | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f | |
with: | |
disable-sudo: true | |
egress-policy: audit | |
- name: 'Checkout Repository' | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 | |
with: | |
fetch-depth: 0 | |
fetch-tags: true | |
- name: Get the Latest Version | |
id: get_version | |
run: bash ${GITHUB_WORKSPACE}/workflow_scripts/get_latest_version.sh | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
REGISTRY: ${{ env.REGISTRY }} | |
REPOSITORY: ${{ env.REPOSITORY }} | |
- name: Log Into Registry | |
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build and Push Docker image | |
id: build | |
uses: docker/build-push-action@48aba3b46d1b1fec4febb7c5d0c644b249a11355 | |
with: | |
push: true | |
tags: ${{ env.TAG_MAJOR }},${{ env.TAG_MINOR }},${{ env.TAG_PATCH }},${{ env.TAG_LATEST }} | |
# Docs: https://github.com/marketplace/actions/create-release | |
- name: Create Release | |
id: create_release | |
uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 | |
with: | |
body: "A Weekly release containing upgrades to system packages in the base Rocky Linux container." | |
makeLatest: true | |
prerelease: false | |
tag: ${{ env.VERSION }} |