-
Notifications
You must be signed in to change notification settings - Fork 9
65 lines (56 loc) · 1.61 KB
/
ci.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: CI
on:
workflow_dispatch:
schedule:
- cron: "19 19 */7 * *"
pull_request:
paths-ignore:
- "**.md"
push:
branches:
- main
paths-ignore:
- "**.md"
jobs:
hadolint:
uses: peaceiris/workflows/.github/workflows/hadolint.yml@main
main:
runs-on: ubuntu-24.04
permissions:
actions: write
contents: read
packages: write
timeout-minutes: 5
strategy:
matrix:
type:
- "slim"
- "mod"
- "full"
steps:
- uses: actions/checkout@v4
# https://github.com/peaceiris/workflows/blob/main/setup-go/action.yml
- uses: peaceiris/workflows/setup-go@v0.21.1
with:
go-version-file: "deps/go.mod"
- uses: peaceiris/actions-export-envs@v1.1.0
id: envs
- name: make build-${{ matrix.type }} with cache
run: make build-${{ matrix.type }}
if: ${{ github.event_name == 'pull_request' }}
env:
ACTIONS_RUNTIME_TOKEN: ${{ steps.envs.outputs.ACTIONS_RUNTIME_TOKEN }}
ACTIONS_CACHE_URL: ${{ steps.envs.outputs.ACTIONS_CACHE_URL }}
- name: make build-${{ matrix.type }} without cache
run: make build-${{ matrix.type }}
if: ${{ github.event_name != 'pull_request' }}
- name: docker login
if: github.event_name != 'pull_request'
env:
DOCKER_HUB_TOKEN: ${{ secrets.DOCKER_HUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
make login
make login-ghcr
- run: make push-${{ matrix.type }}
if: github.event_name != 'pull_request'