-
Notifications
You must be signed in to change notification settings - Fork 7
93 lines (82 loc) · 3.11 KB
/
release-please.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
93
name: Run Release Please
on:
push:
branches:
- main
permissions:
contents: read
env:
REGISTRY: ghcr.io
FLAGD_IMAGE_NAME: flagd-testbed
SYNC_IMAGE_NAME: sync-testbed
GO_VERSION: 1.19.3
jobs:
release-please:
permissions:
contents: write # for google-github-actions/release-please-action to create release commit
pull-requests: write # for google-github-actions/release-please-action to create release PR
runs-on: ubuntu-latest
# Release-please creates a PR that tracks all changes
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
command: manifest
token: ${{secrets.GITHUB_TOKEN}}
default-branch: main
outputs:
release_created: ${{ steps.release.outputs.release_created }}
release_tag_name: ${{ steps.release.outputs.tag_name }}
build-push:
needs: release-please
name: build and push image to the github registery
permissions:
packages: write
runs-on: ubuntu-latest
if: ${{ needs.release-please.outputs.release_created }}
steps:
- uses: actions/checkout@v3
with:
ref: ${{ needs.release-please.outputs.release_tag_name }}
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push flagd-testbed Docker image
uses: docker/build-push-action@v4
with:
context: .
file: flagd/Dockerfile
push: true
tags: |
${{ env.REGISTRY }}/open-feature/${{ env.FLAGD_IMAGE_NAME }}:${{ needs.release-please.outputs.release_tag_name }}
${{ env.REGISTRY }}/open-feature/${{ env.FLAGD_IMAGE_NAME }}:latest
- name: Build and push flagd-testbed-unstable Docker image
uses: docker/build-push-action@v4
with:
context: .
file: flagd/Dockerfile.unstable
push: true
tags: |
${{ env.REGISTRY }}/open-feature/${{ env.FLAGD_IMAGE_NAME }}-unstable:${{ needs.release-please.outputs.release_tag_name }}
${{ env.REGISTRY }}/open-feature/${{ env.FLAGD_IMAGE_NAME }}-unstable:latest
- name: Build and push sync-testbed Docker image
uses: docker/build-push-action@v4
with:
context: .
file: sync/Dockerfile
push: true
tags: |
${{ env.REGISTRY }}/open-feature/${{ env.SYNC_IMAGE_NAME }}:${{ needs.release-please.outputs.release_tag_name }}
${{ env.REGISTRY }}/open-feature/${{ env.SYNC_IMAGE_NAME }}:latest
- name: Build and push sync-testbed-unstable Docker image
uses: docker/build-push-action@v4
with:
context: .
file: sync/Dockerfile.unstable
push: true
tags: |
${{ env.REGISTRY }}/open-feature/${{ env.SYNC_IMAGE_NAME }}-unstable:${{ needs.release-please.outputs.release_tag_name }}
${{ env.REGISTRY }}/open-feature/${{ env.SYNC_IMAGE_NAME }}-unstable:latest