forked from 5afe/safe-relay-service
-
Notifications
You must be signed in to change notification settings - Fork 1
47 lines (39 loc) · 1.27 KB
/
tagbuild.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: Build docker and upload to registry
on:
push:
tags:
# strict semver regex
- v[1-9]+.[0-9]+.[0-9]+* # allows prerelease tags
jobs:
build-and-push:
name: build-and-push
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: |
sudo snap install doctl
sudo snap connect doctl:dot-docker
- name: Configure auth for Digital Ocean
run: |
doctl auth init -t ${{ secrets.CIRCLES_CI_DO_TOKEN }}
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v3
- name: Get ref
run: echo "RELEASE_VERSION=${GITHUB_REF/refs\/tags\//}">> $GITHUB_ENV
- name: Digital Ocean Registry login
run: |
doctl registry login
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
push: true
tags: |
registry.digitalocean.com/circles-registry/safe-relay-service:${{ env.RELEASE_VERSION }}
joincircles/safe-relay-service:latest
joincircles/safe-relay-service:${{ env.RELEASE_VERSION }}