Skip to content

Commit

Permalink
Add GHCR image build and push workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Anton Engelhardt <[email protected]>
  • Loading branch information
antonengelhardt committed Feb 9, 2024
1 parent 179496c commit 258d957
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- hotfix-url-headers

env:
CARGO_TERM_COLOR: always
Expand Down Expand Up @@ -71,3 +72,23 @@ jobs:
context: .
push: true
tags: antonengelhardt/wasm-oidc-plugin:latest

ghcr-image:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

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

- name: Push to GHCR
run:
docker build -t ghcr.io/antonengelhardt/wasm-oidc-plugin:latest .
docker push ghcr.io/antonengelhardt/wasm-oidc-plugin:latest

24 changes: 24 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,27 @@ jobs:
context: .
push: true
tags: antonengelhardt/wasm-oidc-plugin:${{ env.VERSION }}

ghcr-image:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

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

- name: Extract version from Github Ref
id: extract_version
run: |
echo VERSION=$(echo ${{ github.ref }} | grep -o "v[0-9]\+\.[0-9]\+\.[0-9]\+") >> $GITHUB_ENV
- name: Push to GHCR
run:
docker build -t ghcr.io/antonengelhardt/wasm-oidc-plugin:${{ env.VERSION }} .
docker push ghcr.io/antonengelhardt/wasm-oidc-plugin:${{ env.VERSION }}

0 comments on commit 258d957

Please sign in to comment.