Skip to content

Commit ea640b2

Browse files
committed
ci: add release workflow
1 parent bb76fee commit ea640b2

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

.github/workflows/release.yml

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: GHCR Release CI
2+
3+
on:
4+
push:
5+
tags:
6+
- "[0-9]+.[0-9]+.[0-9]+"
7+
8+
env:
9+
HAS_SECRETS: ${{ secrets.HAS_SECRETS }}
10+
11+
jobs:
12+
tests:
13+
name: Release new Docker Image in GHCR
14+
strategy:
15+
matrix:
16+
python-version: [3.12]
17+
os: [ubuntu-latest]
18+
runs-on: ${{ matrix.os }}
19+
timeout-minutes: 60
20+
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v4
24+
with:
25+
fetch-depth: 0
26+
27+
- name: Initialise gopass
28+
uses: camptocamp/initialise-gopass-summon-action@v2
29+
with:
30+
ci-gpg-private-key: ${{secrets.CI_GPG_PRIVATE_KEY}}
31+
github-gopass-ci-token: ${{secrets.GOPASS_CI_GITHUB_TOKEN}}
32+
if: env.HAS_SECRETS == 'HAS_SECRETS'
33+
34+
- name: Set up Python ${{ matrix.python-version }}
35+
uses: actions/setup-python@v5
36+
with:
37+
python-version: ${{ matrix.python-version }}
38+
39+
- name: Upgrade pip version
40+
run: |
41+
python -m pip install -U pip
42+
43+
- run: echo "${HOME}/.local/bin" >> ${GITHUB_PATH}
44+
45+
- name: Install CI dependencies
46+
run: python3 -m pip install --user --requirement=ci/requirements.txt
47+
48+
- name: Environment information
49+
run: c2cciutils-env
50+
env:
51+
GITHUB_EVENT: ${{ toJson(github) }}
52+
53+
- name: Login to GHCR
54+
uses: docker/login-action@v3
55+
with:
56+
registry: ghcr.io
57+
username: ${{github.repository_owner}}
58+
password: ${{secrets.GITHUB_TOKEN}}
59+
60+
- name: Build Docker images for GHCR
61+
run: make build_ghcr
62+
63+
- name: Push Docker images to GHCR
64+
run: make push_ghcr

0 commit comments

Comments
 (0)