-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (40 loc) · 1.57 KB
/
dockerimage.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
name: Docker Image CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Build the Docker image
run: docker build . --file Dockerfile --tag dev-sqs
- uses: actions/checkout@v1
- name: Run tests
run: >
docker run -d --name dev-sqs -p 9324:9324 dev-sqs &&
npm i &&
NO_SERVER=1 npm t &&
docker kill dev-sqs
- name: Tag docker image for public registry
run: >
docker tag dev-sqs jameskyburz/dev-sqs &&
docker tag dev-sqs jameskyburz/dev-sqs:$(git describe --tags)
- name: Login to public docker registry
run: >
echo ${{ secrets.DOCKERHUB_PASSWORD }} |
docker login --username ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin
- name: Publish docker images to public registry
run: >
docker push jameskyburz/dev-sqs:latest &&
docker push jameskyburz/dev-sqs:$(git describe --tags)
- name: Tag docker image for github registry
run: >
docker tag dev-sqs docker.pkg.github.com/jameskyburz/dev-sqs/dev-sqs &&
docker tag dev-sqs docker.pkg.github.com/jameskyburz/dev-sqs/dev-sqs:$(git describe --tags)
- name: Login to github registry
run: >
echo ${{ secrets.GITHUB_TOKEN }} |
docker login docker.pkg.github.com --username JamesKyburz --password-stdin
- name: Publish docker images to github
run: >
docker push docker.pkg.github.com/jameskyburz/dev-sqs/dev-sqs:latest &&
docker push docker.pkg.github.com/jameskyburz/dev-sqs/dev-sqs:$(git describe --tags)