Skip to content

Commit

Permalink
push docker image to ghcr.io
Browse files Browse the repository at this point in the history
  • Loading branch information
navigaid committed Oct 30, 2023
1 parent 3f01829 commit 79ffb2e
Showing 1 changed file with 28 additions and 3 deletions.
31 changes: 28 additions & 3 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,49 @@ jobs:
- run: docker build -f Dockerfile -t subdirectory/subshell:${{ github.sha }} .
name: docker build


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

- run: |
docker tag subdirectory/subshell:${{ github.sha }} ghcr.io/subdirectory/subshell:${{ github.sha }}
docker push subdirectory/subshell:${{ github.sha }}
name: docker push ghcr sha
- run: |
docker tag subdirectory/subshell:${{ github.sha }} ghcr.io/subdirectory/subshell
docker push ghcr.io/subdirectory/subshell
if: github.ref == 'refs/heads/main'
name: docker push ghcr latest
- run: |
docker tag subdirectory/subshell:${{ github.sha }} ghcr.io/subdirectory/subshell:${{ github.ref_name }}
docker push ghcr.io/subdirectory/subshell:${{ github.ref_name }}
name: docker push ghcr tag
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- run: docker push subdirectory/subshell:${{ github.sha }}
name: docker push
name: docker push dockerhub sha

- run: |
docker tag subdirectory/subshell:${{ github.sha }} subdirectory/subshell
docker push subdirectory/subshell
if: github.ref == 'refs/heads/main'
name: docker push latest
name: docker push dockerhub latest
# get git tag
# https://github.com/orgs/community/discussions/26686
- run: |
docker tag subdirectory/subshell:${{ github.sha }} subdirectory/subshell:${{ github.ref_name }}
docker push subdirectory/subshell:${{ github.ref_name }}
name: docker push tag
name: docker push dockerhub tag

0 comments on commit 79ffb2e

Please sign in to comment.