-
Notifications
You must be signed in to change notification settings - Fork 72
61 lines (56 loc) · 1.74 KB
/
main.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
name: main
on: push
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
dist: [debian, alpine, jdk11]
steps:
- name: Setup BATS
uses: bats-core/[email protected]
- uses: actions/checkout@v2
- name: test test-${{ matrix.dist }}
run: make test-${{ matrix.dist }}
deploy-tag:
needs: test
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v2
- name: docker login
shell: bash
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin
- name: Login to Packages Container registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: deploy
run: |-
TAG="$(echo ${{ github.event.ref }} | sed 's|refs/tags/||g')"
./publish.sh $TAG
deploy-latest:
needs: test
runs-on: ubuntu-latest
if: github.event.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v2
- name: docker login
shell: bash
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: echo $DOCKER_PASSWORD | docker login -u $DOCKER_USERNAME --password-stdin
- name: Login to Packages Container registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: deploy
run: ./publish.sh latest