Skip to content

Commit

Permalink
chore: add image pub workflow
Browse files Browse the repository at this point in the history
Signed-off-by: jrhender <[email protected]>
  • Loading branch information
jrhender committed Feb 6, 2025
1 parent b4ff7b5 commit a494cfc
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/container-image-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build and Publish Docker Image

on:
workflow_dispatch:
push:
branches:
- container-package-publish

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

permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Get latest release version
id: get_version
run: |
LATEST_VERSION=$(gh release list --limit 1 --json tagName --jq '.[0].tagName')
echo "LATEST_VERSION=${LATEST_VERSION}" >> $GITHUB_ENV
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Log in to GitHub Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin

- name: Build Docker image
run: |
docker build -t ghcr.io/${{ github.repository }}:${{ env.LATEST_VERSION }} -f apps/vc-api/Dockerfile apps/vc-api
- name: Push Docker image to GitHub Packages
run: |
docker push ghcr.io/${{ github.repository }}:${{ env.LATEST_VERSION }}

0 comments on commit a494cfc

Please sign in to comment.