-
Notifications
You must be signed in to change notification settings - Fork 34
39 lines (37 loc) · 1.08 KB
/
docker-dev-image-build.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
name: Build docker Dev image and push
on:
push:
branches:
- dev
paths-ignore: # Don't trigger on listed files
- .github/CODEOWNERS
- '*.md'
- 'docs/**'
- docker-compose.yml
- .gitignore
- .dockerignore
env:
DOCKER_REGISTRY: registry.digitalocean.com/aact
SERVICE_NAME: aact-core
jobs:
build_and_push:
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/checkout@v3
- name: Build image
run: docker build -t ${{ env.SERVICE_NAME }} .
- name: Install doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- name: Log in to DO Container Registry
run: doctl registry login --expiry-seconds 600
- name: Tag image
run: |
docker tag ${{ env.SERVICE_NAME }} \
${{ env.DOCKER_REGISTRY }}/${{ env.SERVICE_NAME }}:dev
- name: Push image to DO Container Registry
run: |
docker push \
${{ env.DOCKER_REGISTRY }}/${{ env.SERVICE_NAME }}:dev