Skip to content

Commit

Permalink
ci: Add Docker image publishing on ghcr
Browse files Browse the repository at this point in the history
  • Loading branch information
pikhovkin committed Jan 11, 2025
1 parent 3d146ef commit d01f3ac
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
types: [created]

jobs:
build-and-publish:
build-and-publish-on-pypi:
if: github.event_name == 'release' && github.event.action == 'created'
runs-on: ubuntu-latest
steps:
Expand All @@ -23,3 +23,21 @@ jobs:
- name: Publish package
run : |
hatch publish -u __token__ -a ${{ secrets.PYPI_API_TOKEN }}
build-and-publish-on-ghcr:
if: github.event_name == 'release' && github.event.action == 'created'
runs-on: ubuntu-latest
env:
DJANGO_SETTINGS_MODULE: tests.conf.settings.demo
GHCR_IMAGE_NAME: "ghcr.io/pikhovkin/${GITHUB_REPOSITORY:10}"
TAG: ${GITHUB_REF:10}
steps:
- uses: actions/checkout@v3
- name: Docker login
run: echo ${{ secrets.GHCR_TOKEN }} | docker login ghcr.io -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
- name: Build the Docker image
run: |
docker build -f docker/Dockerfile -t ${{ env.GHCR_IMAGE_NAME }}-demo:${{ env.TAG }} .
- name: Docker push
run: |
docker push ${{ env.GHCR_IMAGE_NAME }}-demo:${{ env.TAG }}

0 comments on commit d01f3ac

Please sign in to comment.