-
Notifications
You must be signed in to change notification settings - Fork 4
58 lines (52 loc) · 1.75 KB
/
publish-containers.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
on:
push:
branches:
- main
paths:
- '.release-please-manifest.json'
name: publish-containers
jobs:
publish-containers:
name: Build & Publish Containers
runs-on: ubuntu-latest
steps:
- name: Code checkout
uses: actions/checkout@v2
- name: Get release number
id: get-release
run: |
RELEASE=$(sed 's/"."/"key"/g' .release-please-manifest.json | jq -r .key)
echo ${RELEASE}
echo ::set-output name=release-number::${RELEASE}
- name: Show version
run: |
echo "Version: ${{ steps.get-release.outputs.release-number }}"
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Quay.io
uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.QUAY_USER }}
password: ${{ secrets.QUAY_TOKEN }}
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and export to Docker
uses: docker/build-push-action@v3
with:
context: .
push: true
build-args: |
RUBY_VERSION=3.1.2
TERRAFORM_VERSIONS=0.14.7 1.2.4 1.2.5
tags: |
ghcr.io/${{ github.repository }}:${{ steps.get-release.outputs.release-number }}
quay.io/dwp/kitchen-terraform:${{ steps.get-release.outputs.release-number }}
dwpdigital/kitchen-terraform:${{ steps.get-release.outputs.release-number }}