Add docker build and publish task
Signed-off-by: trivernis <trivernis@protonmail.com>pull/3/head
parent
0f822aaf38
commit
d8d7211b21
@ -0,0 +1,35 @@
|
|||||||
|
name: Publish Docker image to GitHub Package Registry
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main ]
|
||||||
|
pull_request:
|
||||||
|
branches: [ main ]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- name: Copy Repo Files
|
||||||
|
uses: actions/checkout@master
|
||||||
|
|
||||||
|
- name: Publish Docker Image to GPR
|
||||||
|
uses: machine-learning-apps/gpr-docker-publish@master
|
||||||
|
id: docker
|
||||||
|
with:
|
||||||
|
IMAGE_NAME: 'user-management-server'
|
||||||
|
DOCKERFILE_PATH: 'Dockerfile'
|
||||||
|
BUILD_CONTEXT: '.'
|
||||||
|
CACHE: true
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Show outputs of previous step
|
||||||
|
run: |
|
||||||
|
echo "The name:tag of the Docker Image is: $VAR1"
|
||||||
|
echo "The docker image is hosted at $VAR2"
|
||||||
|
env:
|
||||||
|
VAR1: ${{ steps.docker.outputs.IMAGE_SHA_NAME }}
|
||||||
|
VAR2: ${{ steps.docker.outputs.IMAGE_URL }}
|
Loading…
Reference in New Issue