forked from dogtagpki/tomcatjss
-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (54 loc) · 1.67 KB
/
publish.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
name: Publish Tomcat JSS
on:
push:
branches:
- v7
env:
NAMESPACE: ${{ vars.REGISTRY_NAMESPACE || github.repository_owner }}
jobs:
init:
name: Initialization
uses: ./.github/workflows/init.yml
secrets: inherit
if: vars.REGISTRY != ''
build:
name: Waiting for build
needs: init
runs-on: ubuntu-latest
steps:
- name: Wait for build
uses: lewagon/[email protected]
with:
ref: ${{ github.ref }}
check-name: 'Building Tomcat JSS'
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 30
publish:
name: Publishing Tomcat JSS
needs: [init, build]
runs-on: ubuntu-latest
steps:
- name: Log in to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ${{ vars.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
if: vars.REGISTRY == 'ghcr.io'
- name: Log in to other container registry
uses: docker/login-action@v2
with:
registry: ${{ vars.REGISTRY }}
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
if: vars.REGISTRY != 'ghcr.io'
- name: Retrieve tomcatjss-dist image
uses: actions/cache@v3
with:
key: tomcatjss-dist-${{ github.sha }}
path: tomcatjss-dist.tar
- name: Publish tomcatjss-dist image
run: |
docker load --input tomcatjss-dist.tar
docker tag tomcatjss-dist ${{ vars.REGISTRY }}/$NAMESPACE/tomcatjss-dist:7
docker push ${{ vars.REGISTRY }}/$NAMESPACE/tomcatjss-dist:7