Skip to content

Build docker and upload to registry #139

Build docker and upload to registry

Build docker and upload to registry #139

Workflow file for this run

name: Build docker and upload to registry
on:
push:
tags:
# strict semver regex
- v[0-9]+.[0-9]+.[0-9]+*
jobs:
build-and-push:
name: build-and-push
runs-on: ubuntu-22.04
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_PASSWORD }}
- name: Checkout
uses: actions/checkout@v4
- name: Get ref
id: parse_ref
run: |
echo "tag=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
- name: Digital Ocean Registry login
run: |
doctl registry login
- name: Build and push
uses: docker/build-push-action@v3
with:
context: .
push: true
tags: |
registry.digitalocean.com/circles-registry/circles-api:${{ steps.parse_ref.outputs.tag }}
joincircles/circles-api:latest
joincircles/circles-api:${{ steps.parse_ref.outputs.tag }}