This repository has been archived by the owner on Jun 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
116 lines (98 loc) · 3.4 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
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
name: Release build
env:
version: ${{ github.release.tag_name }}
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
name: .NET restore, build & test
steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
6.0.x
- name: Restore dependencies
run: dotnet restore ./src/EasyAuthForK8s.Web/EasyAuthForK8s.Web.csproj
- name: Build
run: dotnet build ./src/EasyAuthForK8s.Web/EasyAuthForK8s.Web.csproj --no-restore
- name: Test
run: dotnet test ./src/Tests/EasyAuthForK8s.Tests.Web/EasyAuthForK8s.Tests.Web.csproj --no-build --verbosity normal
check_for_deprecated_APIs:
needs: build
name: Check Deprecated K8s APIs
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Download Pluto
uses: FairwindsOps/pluto/github-action@master
- name: Use pluto
run: |
pluto detect-files -d ./charts/easyauth-proxy
pluto detect-files -d ./
push_to_registries:
needs: check_for_deprecated_APIs
name: Push Docker image to multiple registries
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER_ID }}
password: ${{ secrets.DOCKER_REGISTRY_PASS }}
- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v4
with:
images: |
ghcr.io/${{ github.repository }}/easy-auth-proxy
easyauthfork8s/easy-auth-proxy
flavor: |
latest=false
- name: Build and push Docker images
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
run_e2e_test:
needs: push_to_registries
runs-on: ubuntu-latest
environment: prod
name: Run main.sh script
steps:
- name: 'Login via Azure CLI'
uses: azure/login@v1
with:
creds: ${{ secrets.CAE_AZURE_CREDENTIALS }}
- uses: actions/checkout@v2
- name: Call the script
continue-on-error: true
run: |
bash main.sh -a "${{ vars.prodPrefix }}-${{ env.version }}" -c "${{ vars.prodPrefix }}-${{ env.version }}" -r "${{ vars.prodPrefix }}-${{ env.version }}" -e ${{ vars.email }} -l ${{ vars.location }} -v ${{ env.version }}
- name: Delete e2e environment
if: ${{ vars.DeleteOnFailure == 'true' }} || success()
run: |
if [ $(az group exists --name ${{ vars.prodPrefix }}-${{ env.iteration }}) == "true" ]; then
az group delete -n ${{ vars.prodPrefix }}-${{ env.iteration }} --yes
fi
app_id=$(az ad app list --display-name ${{ vars.prodPrefix}}-${{ env.iteration }} --query "[0].appId" -o tsv)
if [ "$app_id" != "" ]; then
az ad app delete --id $app_id
fi