-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add workflow file to build p2k16-label docker image, part of fixing #19.
- Loading branch information
Showing
1 changed file
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' }} |