Skip to content

Build base image and reuse for main build. #1

Build base image and reuse for main build.

Build base image and reuse for main build. #1

name: Base Docker Image CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Login to DigitalOcean Container Registry
uses: docker/login-action@v3
with:
registry: registry.digitalocean.com
username: ${{ secrets.DIGITALOCEAN_USERNAME }}
password: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }}
- uses: actions/checkout@v3
- name: Build the Docker image
run: docker build . --file build/base.Dockerfile --tag thesmile-base:latest
- name: Tag for DO
run: docker image tag thesmile-base:latest registry.digitalocean.com/thesmile/thesmile:latest
- name: Tag sha for DO
run: docker image tag thesmile-base:latest registry.digitalocean.com/thesmile/thesmile:$(echo $GITHUB_SHA | head -c7)
- name: Push to DO
run: docker push registry.digitalocean.com/thesmile/thesmile-base:latest
- name: Push to DO
run: docker push registry.digitalocean.com/thesmile/thesmile-base:$(echo $GITHUB_SHA | head -c7)