-
Notifications
You must be signed in to change notification settings - Fork 13
32 lines (30 loc) · 1.17 KB
/
docker-publish-image.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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