-
Notifications
You must be signed in to change notification settings - Fork 1
72 lines (63 loc) · 2.21 KB
/
release-weekly.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
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 }}