Skip to content

Commit

Permalink
Login to dockerhub
Browse files Browse the repository at this point in the history
Signed-off-by: Aisuko <[email protected]>
  • Loading branch information
Aisuko committed Mar 18, 2024
1 parent 2541c54 commit 402365c
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions .github/workflows/ci-backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Check repository
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
Expand Down Expand Up @@ -57,7 +57,7 @@ jobs:
- name: Check repository
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
Expand Down Expand Up @@ -183,7 +183,7 @@ jobs:
- name: Check repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Display Python version
Expand All @@ -194,17 +194,15 @@ jobs:
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Login to Github Container Registry
uses: docker/login-action@v3
# if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') && success()
if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') && success()
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build Docker image
if: startsWith(github.ref, 'refs/tags/') != true && success()
run: |
docker build -t ${{ secrets.DOCKER_REGISTRY }}/${{ secrets.IMAGE_NAME }}:${GITHUB_SHA::7} .
docker push ${{ secrets.DOCKER_REGISTRY }}/${{ secrets.IMAGE_NAME }}:${GITHUB_SHA::7}
- name: Push Docker image
if: github.event_name != 'pull_request' && startsWith(github.ref, 'refs/tags/') && success()
run: |
docker push ghcr.io/${{ secrets.DOCKER_REGISTRY }}/${{ secrets.IMAGE_NAME }}:${GITHUB_SHA::7}
docker push ghcr.io/${{ secrets.DOCKER_REGISTRY }}/${{ secrets.IMAGE_NAME }}:${GITHUB_REF/refs\/tags\//}

0 comments on commit 402365c

Please sign in to comment.