Get CI/CD working again (VPS-11003) #28
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: self-hosted | |
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 |