Skip to content

Commit

Permalink
Push to GHCR pipeline (#70)
Browse files Browse the repository at this point in the history
* Push to GHCR pipeline

* Rename PR workflow

Co-authored-by: AleF83 <[email protected]>
  • Loading branch information
shaikatz and AleF83 committed Mar 10, 2021
1 parent 446de57 commit 8e1dd96
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/main.yaml → .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run Tests
name: PR

on:
push:
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/tag.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build and push new image version

on:
create:
tags:
- v*

jobs:
build_push:
name: Build and Push
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Login to GHCR
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ secrets.ORG_CR_WRITER_USER }}
password: ${{ secrets.ORG_CR_WRITER_PASSWORD }}

- id: get_version
name: Format docker image tag
uses: battila7/get-version-action@v2

- id: repository_owner
name: Format repository owner
uses: ASzc/change-string-case-action@v1
with:
string: ${{ github.repository_owner }}

- name: Build and push new docker image
uses: docker/build-push-action@v2
with:
push: true
context: ./src
file: ./src/Dockerfile
tags: |
ghcr.io/${{ steps.repository_owner.outputs.lowercase }}/oidc-server-mock:latest
ghcr.io/${{ steps.repository_owner.outputs.lowercase }}/oidc-server-mock:${{ steps.get_version.outputs.version-without-v }}
labels: |
org.opencontainers.image.source=${{ github.event.repository.html_url }}

0 comments on commit 8e1dd96

Please sign in to comment.