Skip to content

Commit

Permalink
Merge pull request #43 from mrsarm/feature/push-image
Browse files Browse the repository at this point in the history
Publish docker image from CI
  • Loading branch information
mrsarm authored Apr 17, 2024
2 parents 2c86b71 + 52856c0 commit 79ed3fa
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,22 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build the Docker image
run: ./docker-build.sh "${GITHUB_REF#refs/heads/}"
run: ./docker-build.sh "${GITHUB_REF_SLUG}"
- name: Run tests
run: docker run --rm -e PROCESS_TYPE=test --name django-coleman "mrsarm/django-coleman:${GITHUB_REF#refs/heads/}"
run: docker run --rm -e PROCESS_TYPE=test --name django-coleman "mrsarm/django-coleman:${GITHUB_REF_SLUG}"
- name: Push Docker image
run: docker push "mrsarm/django-coleman:${GITHUB_REF_SLUG}"
- name: Tag "latest"
if: ${{ github.ref == 'refs/heads/master' }}
run: docker tag "mrsarm/django-coleman:${GITHUB_REF_SLUG}" mrsarm/django-coleman:latest
- name: Release "latest"
if: ${{ github.ref == 'refs/heads/master' }}
run: docker push mrsarm/django-coleman:latest

0 comments on commit 79ed3fa

Please sign in to comment.