-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (45 loc) · 1.24 KB
/
main.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
name: Task Tests
on:
push:
branches:
- main
pull_request:
env:
IMAGE_BASE: ${{ github.repository }}
IMAGE_NAME: adoc-toolset
jobs:
tests:
name: Tests
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
-
name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
-
name: Run tests
run: |
set -o pipefail
make ci | sed ''/PASS/s//$(printf "\033[32mPASS\033[0m")/'' | sed ''/FAIL/s//$(printf "\033[31mFAIL\033[0m")/''
-
name: Log into ghcr.io
if: ${{ github.event_name != 'pull_request' }}
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
-
name: Push images to ghcr.io
if: ${{ github.event_name != 'pull_request' }}
run: |
echo "::group::Push ${IMAGE_NAME} to ghcr.io"
docker tag localhost:5000/ods-pipeline/${IMAGE_NAME}:latest ghcr.io/${IMAGE_BASE,,}/${IMAGE_NAME}:latest
docker push ghcr.io/${IMAGE_BASE,,}/${IMAGE_NAME}:latest
echo "::endgroup::"