File tree Expand file tree Collapse file tree 1 file changed +32
-22
lines changed Expand file tree Collapse file tree 1 file changed +32
-22
lines changed Original file line number Diff line number Diff line change 2
2
name : Build PostgreSQL images
3
3
4
4
on :
5
+ # trigger every sunday morning
5
6
schedule :
6
7
- cron : " 2 2 * * SUN"
8
+ # trigger on PR merge and push to master branch
7
9
push :
10
+ branches :
11
+ - master
12
+ # trigger on PR
13
+ pull_request :
14
+ branches :
15
+ - master
8
16
9
17
jobs :
10
- build :
18
+ build-and-push :
19
+ if : github.event_name == 'push' || github.event_name == 'schedule'
20
+ runs-on : ubuntu-latest
21
+ timeout-minutes : 120
22
+
23
+ steps :
24
+ - name : Checkout code
25
+ uses : actions/checkout@v2
11
26
27
+ - name : Log in to GitHub Container Registry
28
+ run : echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
29
+
30
+ - name : Log in to Docker Hub
31
+ run : echo "${{ secrets.DOCKER_HUB_TOKEN }}" | docker login docker.io -u dockerc2c --password-stdin
32
+
33
+ - name : Build and push with Docker
34
+ run : make PUSH_DOCKER_HUB=true PUSH_GHCR=true
35
+
36
+ build-on-pr :
37
+ if : github.event_name == 'pull_request'
12
38
runs-on : ubuntu-latest
13
39
timeout-minutes : 120
14
40
15
41
steps :
16
- - uses : actions/checkout@v2
17
-
18
- - uses : camptocamp/initialise-gopass-summon-action@v2
19
- with :
20
- ci-gpg-private-key : ${{secrets.CI_GPG_PRIVATE_KEY}}
21
- github-gopass-ci-token : ${{secrets.GOPASS_CI_GITHUB_TOKEN}}
22
- patterns : docker
23
-
24
- - name : " Build images"
25
- env :
26
- PUSH_DOCKER_HUB : false
27
- PUSH_GHCR : false
28
- run : |
29
- make all
30
- - name : " Push images"
31
- env :
32
- PUSH_DOCKER_HUB : true
33
- PUSH_GHCR : true
34
- run : |
35
- make all
36
- if : github.ref == 'master'
42
+ - name : Checkout code
43
+ uses : actions/checkout@v2
44
+
45
+ - name : Build without pushing
46
+ run : make
You can’t perform that action at this time.
0 commit comments