-
Notifications
You must be signed in to change notification settings - Fork 204
34 lines (31 loc) · 1.03 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
name: Docker
on: [push, pull_request]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: reviewdog/action-shellcheck@v1
- name: Install Dependencies
run: make install
# - name: Build
# run: ./scripts/build.sh
- name: Test
run: make test
# https://www.prestonlamb.com/blog/creating-a-docker-image-with-github-actions
publish:
name: Publish
needs: [build]
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/v[0-9]+'))
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Dependencies
run: make install
- name: Login to DockerHub Registry
run: echo ${{ secrets.DOCKER_PERSONAL_ACCESS_TOKEN }} | docker login -u zixia --password-stdin
- name: Build the Docker image
run: docker build -t artifact_image .
- name: Deploy to Docker Hub
run: bash -x ./scripts/deploy.sh artifact_image