-
Notifications
You must be signed in to change notification settings - Fork 1
35 lines (32 loc) · 1.02 KB
/
publish_docker.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
33
34
35
name: Publish Docker image to GitHub Package Registry
on:
push:
branches: master
pull_request:
branches: master
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Get docker tag
id: tag
run: |
MYTAG=$(echo $GITHUB_REF | sed -e 's#refs/heads/master#latest#' | sed -e 's#refs/pull/\([^/]*\)/.*#pr_\1#')
echo "MYTAG=$MYTAG"
echo "::set-output name=DOCKER_TAG::$MYTAG"
env:
GITHUB_REF: ${{ github.ref }}
- name: Copy Repo Files
uses: actions/checkout@v2
#This Action Emits 2 Variables, IMAGE_SHA_NAME and IMAGE_URL
#which you can reference in subsequent steps
- name: Publish Docker Image to GPR
uses: machine-learning-apps/gpr-docker-publish@master
id: docker
with:
IMAGE_NAME: 'lindat-billing'
TAG: ${{ steps.tag.outputs.DOCKER_TAG }}
DOCKERFILE_PATH: 'Docker/frontend/Dockerfile'
BUILD_CONTEXT: './'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}