Skip to content

Fixing up base image build base-docker-image.yml #5

Fixing up base image build base-docker-image.yml

Fixing up base image build base-docker-image.yml #5

name: Base Docker Image CI
on:
push:
paths:
- build/base.Dockerfile
- .github/workflows/base-docker-image.yml
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-base:latest
- name: Tag sha for DO
run: docker image tag thesmile-base:latest registry.digitalocean.com/thesmile/thesmile-base:$(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)