-
Notifications
You must be signed in to change notification settings - Fork 2
78 lines (78 loc) · 3.09 KB
/
release.yaml
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: Image Release
on:
pull_request:
types:
- closed
branches:
- main
paths:
- "Dockerfile"
jobs:
release:
if: github.event.pull_request.merged == true
name: Release Image
runs-on: ubuntu-latest
outputs:
new_release_published: "${{ steps.release.outputs.new_release_published }}"
new_release_version: "${{ steps.release.outputs.new_release_version }}"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.AUTOMATION_PAT }}
fetch-depth: 0
ref: 'main'
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2
# with:
# install: true -
- name: setup git config
run: |
git config --global user.name "Catalyst Community Automation"
git config --global user.email "<[email protected]>"
- name: Get semver-tags
run: |
wget -c https://github.com/catalystcommunity/semver-tags/releases/download/v0.3.3/semver-tags.tar.gz -O - | tar -xz
- name: Semver Tags Run
id: semver-tags
run: |
./.github/scripts/do-image-release.sh fullrun
- if: steps.semver-tags.outputs.RELEASED_CHANGES == 'true'
name: Login to Quay.io Container Registry
uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.QUAY_DOCKER_REGISTRY_USER }}
password: ${{ secrets.QUAY_DOCKER_REGISTRY_PASSWORD }}
- if: steps.semver-tags.outputs.RELEASED_CHANGES == 'true'
name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
# list of Docker images to use as base name for tags
images: |
quay.io/catalystcommunity/catalyst-runner-image
# generate Docker tags based on the following events/attributes
# tags: |
# type=semver,pattern=${{ steps.semver-tags.outputs.New_release_version }}
# type=semver,pattern=${{ steps.semver-tags.outputs.New_release_major_version }}.${{ steps.semver-tags.outputs.New_release_minor_version }}
# type=semver,pattern=${{ steps.semver-tags.outputs.New_release_major_version }}
tags: |
type=raw,value=latest
type=raw,value=${{ steps.semver-tags.outputs.New_release_version }}
type=raw,value=${{ steps.semver-tags.outputs.New_release_major_version }}.${{ steps.semver-tags.outputs.New_release_minor_version }}
type=raw,value=${{ steps.semver-tags.outputs.New_release_major_version }}
- if: steps.semver-tags.outputs.RELEASED_CHANGES == 'true'
name: Build and push image to Quay
id: build-push-image
uses: docker/build-push-action@v4
env:
GITHUB_TOKEN: ${{ secrets.AUTOMATION_PAT }}
with:
context: .
file: Dockerfile
tags: ${{ steps.meta.outputs.tags }}
push: true
cache-from: type=gha,mode=max
cache-to: type=gha,mode=max
no-cache: ${{ contains(github.event.head_commit.message, 'no-cache') }}