-
Notifications
You must be signed in to change notification settings - Fork 1
92 lines (75 loc) · 2.87 KB
/
publish-rc.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: Publish Release Candidate
on:
push:
branches:
- "main"
workflow_dispatch:
inputs:
base:
type: string
description: |
The tag of the commit that will be published as release-candidate.
Make sure that you also select that tag as the workflow's run location.
required: false
default: "edge"
permissions: write-all
env:
BASE: ${{ github.event.inputs.base || 'edge' }}
jobs:
tag_rc_image_app:
name: tag rc image app
runs-on: ubuntu-latest
steps:
- name: Login to GitHub Packages
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin
- name: Pull docker image
run: docker pull ${{ vars.BASE_IMAGE_NAME }}-app:${{ env.BASE }}
- name: Tag docker image
run: docker tag ${{ vars.BASE_IMAGE_NAME }}-app:${{ env.BASE }} ${{ vars.BASE_IMAGE_NAME }}-app:release-candidate
- name: Push docker image
run: docker push ${{ vars.BASE_IMAGE_NAME }}-app:release-candidate
tag_rc_image_api:
name: tag rc image api
runs-on: ubuntu-latest
steps:
- name: Login to GitHub Packages
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin
- name: Pull docker image
run: docker pull ${{ vars.BASE_IMAGE_NAME }}-api:${{ env.BASE }}
- name: Tag docker image
run: docker tag ${{ vars.BASE_IMAGE_NAME }}-api:${{ env.BASE }} ${{ vars.BASE_IMAGE_NAME }}-api:release-candidate
- name: Push docker image
run: docker push ${{ vars.BASE_IMAGE_NAME }}-api:release-candidate
tag_rc_image_sync:
name: tag rc image sync
runs-on: ubuntu-latest
steps:
- name: Login to GitHub Packages
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin
- name: Pull docker image
run: docker pull ${{ vars.BASE_IMAGE_NAME }}-sync:${{ env.BASE }}
- name: Tag docker image
run: docker tag ${{ vars.BASE_IMAGE_NAME }}-sync:${{ env.BASE }} ${{ vars.BASE_IMAGE_NAME }}-sync:release-candidate
- name: Push docker image
run: docker push ${{ vars.BASE_IMAGE_NAME }}-sync:release-candidate
tag_rc_commit:
name: "tag rc commit"
needs:
- tag_rc_image_app
- tag_rc_image_api
- tag_rc_image_sync
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get base commit
id: get_base_commit
run: |
git fetch --tags
BASE_COMMIT=$(git rev-list -n 1 $BASE)
echo "sha=$BASE_COMMIT" >> "$GITHUB_OUTPUT"
- name: tag release-candidate
uses: ./.github/actions/tag-commit
with:
TAG_NAME: release-candidate
SHA: ${{ steps.get_base_commit.outputs.sha }}