Skip to content

Commit

Permalink
add package publishing gh action
Browse files Browse the repository at this point in the history
  • Loading branch information
szarbartosz committed Nov 5, 2024
1 parent f66a372 commit fddb9ef
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/publish-ghcr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: hedgeapp backend

on:
push:
branches: [master, develop]

jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GH_PAT }}

- name: Set image tag
run: |
if [[ $GITHUB_REF == refs/heads/master ]]; then
IMAGE_TAG=latest
elif [[ $GITHUB_REF == refs/heads/develop ]]; then
IMAGE_TAG=develop
fi
echo "IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_ENV
- name: Build and push docker image
run: |
docker build --tag ghcr.io/szarbartosz/hedgeapp-back:$IMAGE_TAG
docker push ghcr.io/szarbartosz/hedgeapp-back:$IMAGE_TAG

0 comments on commit fddb9ef

Please sign in to comment.