Skip to content

Commit

Permalink
add workflow file to build p2k16-label docker image, part of fixing #19.
Browse files Browse the repository at this point in the history
  • Loading branch information
tingox committed Nov 3, 2021
1 parent 366c19f commit d44c881
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/docker-image-p2k16-label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build and push p2k16-label docker image

on:
release:
types: [published]

jobs:
build-and-push-docker-image:
runs-on: ubuntu-latest

# steps to perform in job
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Login to Github Packages
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Get the version
id: vars
run: echo ::set-output name=tag::$(echo ${GITHUB_REF:10})

- name: Build image and push to GitHub Container Registry
uses: docker/build-push-action@v2
with:
# relative path to the place where source code with Dockerfile is located
context: ./p2k16-label
# Note: tags has to be all lower-case
tags: |
ghcr.io/bitraf/p2k16-label:${{steps.vars.outputs.tag}}
ghcr.io/bitraf/p2k16-label:latest
# build on feature branches, push only on main branch
push: ${{ github.ref == 'refs/heads/main' }}

0 comments on commit d44c881

Please sign in to comment.