forked from mintel/dex-k8s-authenticator
-
Notifications
You must be signed in to change notification settings - Fork 2
68 lines (58 loc) · 2.01 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
name: Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
releaseVersion:
description: 'Release version'
required: true
jobs:
set-env:
runs-on: ubuntu-latest
outputs:
RELEASE_VERSION: ${{ steps.set_version.outputs.RELEASE_VERSION }}
steps:
- name: Set RELEASE_VERSION from tag
if: github.event_name == 'push'
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
- name: Set RELEASE_VERSION from workflow input
if: github.event_name == 'workflow_dispatch'
run: echo "RELEASE_VERSION=${{ github.event.inputs.releaseVersion }}" >> $GITHUB_ENV
- name: Output RELEASE_VERSION
id: set_version
run: echo "RELEASE_VERSION=${{ env.RELEASE_VERSION }}" >> $GITHUB_OUTPUT
publish-image:
name: Publish Docker image
needs: set-env
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Nix on self-hosted ARC runners
uses: cachix/install-nix-action@V28
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Install devbox
uses: jetify-com/[email protected]
with:
enable-cache: false
skip-nix-installation: true
- name: Granting private modules access
run: |
git config --global url."https://${{ secrets.MESOSPHERECI_USER_TOKEN }}:[email protected]/".insteadOf "https://github.com/"
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build container image
run: devbox run -- make container
env:
GITHUB_TOKEN: ${{ secrets.MESOSPHERECI_USER_TOKEN }}
TAG: ${{ needs.set-env.outputs.RELEASE_VERSION }}
- name: Push container image
run: devbox run -- make push-image
env:
TAG: ${{ needs.set-env.outputs.RELEASE_VERSION }}