forked from voidauth/voidauth
-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (65 loc) · 2.43 KB
/
test.yml
File metadata and controls
74 lines (65 loc) · 2.43 KB
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
name: Test
on:
pull_request:
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Docker QEMU
uses: docker/setup-qemu-action@v3
- name: Docker Buildx
uses: docker/setup-buildx-action@v3
# Login to dockerhub if not a fork PR
- name: Login Dockerhub
if: ${{ github.event.pull_request == null || !github.event.pull_request.head.repo.fork }}
uses: docker/login-action@v3
with:
username: notquitenothing
password: ${{ secrets.DOCKERHUB_TOKEN }}
# Login to docker hardened image registry if not a fork PR
- name: Login Docker Hardened Images Registry
if: ${{ github.event.pull_request == null || !github.event.pull_request.head.repo.fork }}
uses: docker/login-action@v3
with:
registry: dhi.io
username: notquitenothing
password: ${{ secrets.DOCKERHUB_TOKEN }}
# runs for PRs from forks (skip any registry-backed cache)
- name: Build Push (fork - no remote cache)
if: ${{ github.event.pull_request != null && github.event.pull_request.head.repo.fork }}
uses: docker/build-push-action@v6
id: docker-build-fork
with:
context: .
file: Dockerfile
target: build
platforms: linux/amd64,linux/arm64
tags: voidauth/voidauth:test
push: false
cache-from: |
type=gha
type=registry,ref=voidauth/voidauth:latest
type=registry,ref=voidauth/voidauth:edge
# runs for PRs from the same repo (or non-PR runs) and uses registry cache
- name: Build Push (with registry cache)
if: ${{ github.event.pull_request == null || !github.event.pull_request.head.repo.fork }}
uses: docker/build-push-action@v6
id: docker-build
with:
context: .
file: Dockerfile
platforms: linux/amd64,linux/arm64
tags: voidauth/voidauth:test
push: false
cache-from: |
type=gha
type=registry,ref=voidauth/voidauth-cache:test
type=registry,ref=voidauth/voidauth-cache:release
type=registry,ref=voidauth/voidauth:latest
type=registry,ref=voidauth/voidauth:edge
cache-to: type=registry,mode=max,ref=voidauth/voidauth-cache:test