-
Notifications
You must be signed in to change notification settings - Fork 12
44 lines (41 loc) · 1.31 KB
/
main.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
name: Main Workflow
on:
push:
branches: [master]
pull_request:
branches: [master]
env:
IMAGE_SHA: ${{ github.event.pull_request.head.sha || github.sha }}
# If you want your CI build to push images to a Docker repository, define these
# for "Secrets" in your CI settings for the repository:
# private registry to push to
DOCKER_REGISTRY: ${{ secrets.VSCO_DOCKER_REGISTRY }}
# username at the registry
DOCKER_USERNAME: ${{ secrets.VSCO_DOCKER_REGISTRY_USERNAME }}
# the registry password for DOCKER_USERNAME
DOCKER_PASSWORD: ${{ secrets.VSCO_DOCKER_REGISTRY_PASSWORD }}
# repo to push to
DOCKER_REPO: ${{ secrets.DOCKER_REPO }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.14
- name: Run tests
run: script/test
- name: Build dcdr
run: script/build
- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ env.DOCKER_USERNAME }}
password: ${{ env.DOCKER_PASSWORD }}
repository: ${{ env.DOCKER_REPO }}
dockerfile: Dockerfile.archlinux
tag_with_ref: true
tags: ${{ env.IMAGE_SHA }}
push: true