Fixing up base image build base-docker-image.yml #5
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: 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) | |