-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker.yml
47 lines (37 loc) · 1.11 KB
/
docker.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
name: Docker
on:
push:
# Publish `master` as Docker `latest` image.
branches:
- master
env:
# 镜像名称
IMAGE_NAME: ga-test
jobs:
test:
runs-on: ubuntu-latest
steps:
# 进行测试,见官方文档https://docs.docker.com/docker-hub/builds/
- uses: actions/checkout@v2
# - name: Run tests
# run: |
# if [ -f docker-compose.test.yml ]; then
# docker-compose --file docker-compose.test.yml build
# docker-compose --file docker-compose.test.yml run sut
# else
# docker build . --file Dockerfile
# fi
push:
# Ensure test job passes before pushing image.
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v2
- name: Build image
run: docker image build ./ -t linbudu/ga-test:latest
- name: Log into registry
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
- name: Push image
run: |
docker push linbudu/ga-test:latest