-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (75 loc) · 2.1 KB
/
merge.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
#
# SPDX-License-Identifier: Apache-2.0
#
name: Continuous Deployment
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: read
packages: write
env:
GOBIN: ${{ github.workspace }}/bin
PATH: ${{ github.workspace }}/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin
GOVER: 1.17.3
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GOVER }}
- name: Checkout Code
uses: actions/checkout@v2
- name: Lint Code
run: make lint
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GOVER }}
- name: Checkout Code
uses: actions/checkout@v2
- name: Run Tests
run: make tests
env:
MANAGER_APP_ID: ${{ secrets.MANAGER_APP_ID }}
MANAGER_APP_INSTALLATION_ID: ${{ secrets.MANAGER_APP_INSTALLATION_ID }}
MANAGER_APP_PRIVATE_KEY: ${{ secrets.MANAGER_APP_PRIVATE_KEY }}
MANAGER_ADMIN_PAT: ${{ secrets.MANAGER_ADMIN_PAT }}
MANAGER_ORG: ${{ secrets.MANAGER_ORG }}
MANAGER_USER: ${{ secrets.MANAGER_USER }}
build-and-publish:
name: Build and Publish
runs-on: ubuntu-latest
needs:
- lint
- test
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Set outputs
id: vars
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Check outputs
run: echo ${{ steps.vars.outputs.sha_short }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Push
uses: docker/build-push-action@v2
with:
push: true
tags: |
ghcr.io/${{ github.repository }}:${{ steps.vars.outputs.sha_short }}
ghcr.io/${{ github.repository }}:latest