-
Notifications
You must be signed in to change notification settings - Fork 2
65 lines (50 loc) · 1.93 KB
/
release.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
name: Release
on:
push:
branches:
- main
env:
IMAGE_NAME: i4trust/activation-service
IMAGE_NAME_QUAY: quay.io/i4trust/activation-service
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- id: pr
uses: actions-ecosystem/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- uses: zwaldowski/semver-release-action@v2
with:
dry_run: true
bump: ${{ steps.pr.outputs.labels }}
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Set version output
id: out
run: echo "::set-output name=version::$(echo ${VERSION})"
- name: generate temporary tag
run: echo IMAGE_TAG=${{ steps.out.outputs.version }} >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Log into registry
run: echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" --password-stdin
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build and push release
run: |
docker build -t ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }} .
docker push ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
- name: Push to quay.io
run: |
echo "${{ secrets.QUAY_TOKEN }}" | docker login quay.io -u "${{ secrets.QUAY_USERNAME }}" --password-stdin
docker tag ${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }} ${{ env.IMAGE_NAME_QUAY }}:${{ env.IMAGE_TAG }}
docker push ${{ env.IMAGE_NAME_QUAY }}:${{ env.IMAGE_TAG }}
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: ${{ steps.out.outputs.version }}
prerelease: false
title: ${{ steps.out.outputs.version }}
files: |
LICENSE