-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (41 loc) · 1.29 KB
/
docker-build-and-push.yaml
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
48
name: Docker Image build and Push to DO Registry
on:
push:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
steps:
# Prep things for doing doctl stuff
- name: Install doctl
uses: digitalocean/action-doctl@v2
with:
token: ${{ secrets.DO_TOKEN }}
# Do not create permanent tokens
- name: Login to registry
run: doctl registry login --expiry-seconds 600
- name: Pull code
uses: actions/checkout@v2
with:
submodules: 'recursive'
# The only private repo here was removed.
# ssh-key: ${{ secrets.DEPLOY_KEY }}
#
#
- name: Configure Git
run: |
/usr/bin/git config --global user.name "${GITHUB_ACTOR}"
/usr/bin/git config --global user.email "${GITHUB_ACTOR}@thenextbug.com"
- name: Setup SSH Keys and known_hosts
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: |
mkdir -p ~/.ssh
ssh-keyscan github.com >> ~/.ssh/known_hosts
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
ssh-add - <<< "${{ secrets.DEPLOY_KEY }}"
- name: Build and publish submodule projects
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
run: make ci