Skip to content

Merge pull request #188 from tynanford/master #32

Merge pull request #188 from tynanford/master

Merge pull request #188 from tynanford/master #32

name: Build and Publish Docker Image
# Publish Docker image on pushes to main branch, or on-demand.
on:
push:
branches:
- 'master'
workflow_dispatch:
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Get/Set Tag Info
id: project-info
run: ./scripts/write-project-info.sh && ./scripts/set-github-env.sh
- name: Print Tag Info
run: echo "Will build docker image for ${{ steps.project-info.outputs.IMAGE_TAG_LATEST }}, ${{ steps.project-info.outputs.IMAGE_TAG_VERSION }}, and ${{ steps.project-info.outputs.IMAGE_TAG_VERSION_TIMESTAMP }}"
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build, Tag, and Publish Docker Image
uses: docker/build-push-action@v3
with:
context: .
tags: ${{ steps.project-info.outputs.IMAGE_TAG_LATEST }},${{ steps.project-info.outputs.IMAGE_TAG_VERSION }},${{ steps.project-info.outputs.IMAGE_TAG_VERSION_TIMESTAMP }}
push: true