-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (67 loc) · 2.62 KB
/
update-timew-in-docker-images.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
73
74
75
76
77
78
name: Update Timewarrior in Docker images
on:
workflow_dispatch:
inputs:
release:
type: choice
description: Timewarrior release
options:
- develop
- stable
schedule:
- cron: 0 2 * * *
env:
REGISTRY: "ghcr.io"
RELEASE: ${{ github.event.inputs.release || 'develop' }}
jobs:
build-and-push-docker-images:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
- name: Create lowercase repository name
run: |
GHCR_REPOSITORY="${{ github.repository_owner }}"
echo "REPOSITORY=${GHCR_REPOSITORY,,}" >> ${GITHUB_ENV}
- name: Checkout repository
uses: actions/checkout@v4
- name: Install cosign
uses: sigstore/[email protected]
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Taskwarrior [develop]/Timewarrior [${{ env.RELEASE }}] Docker image
id: build-and-push-develop
uses: docker/[email protected]
with:
context: .
file: "./test/docker/task-timew.dockerfile"
push: true
build-args: |
TASK_IMAGE=${{ env.REGISTRY }}/${{ env.REPOSITORY }}/task:develop
TIMEW_IMAGE=${{ env.REGISTRY }}/${{ env.REPOSITORY }}/timew:${{ env.RELEASE }}
tags: ${{ env.REGISTRY }}/${{ env.REPOSITORY }}/task-timew:develop-${{ env.RELEASE }}
- name: Sign the published Docker image
env:
COSIGN_EXPERIMENTAL: "true"
run: cosign sign ${{ env.REGISTRY }}/${{ env.REPOSITORY }}/task-timew@${{ steps.build-and-push-develop.outputs.digest }}
- name: Build and push Taskwarrior [stable]/Timewarrior [${{ env.RELEASE }}] Docker image
id: build-and-push-stable
uses: docker/[email protected]
with:
context: .
file: "./test/docker/task-timew.dockerfile"
push: true
build-args: |
TASK_IMAGE=${{ env.REGISTRY }}/${{ env.REPOSITORY }}/task:stable
TIMEW_IMAGE=${{ env.REGISTRY }}/${{ env.REPOSITORY }}/timew:${{ env.RELEASE }}
tags: ${{ env.REGISTRY }}/${{ env.REPOSITORY }}/task-timew:stable-${{ env.RELEASE }}
- name: Sign the published Docker image
env:
COSIGN_EXPERIMENTAL: "true"
run: cosign sign ${{ env.REGISTRY }}/${{ env.REPOSITORY }}/task-timew@${{ steps.build-and-push-stable.outputs.digest }}