Skip to content

Commit

Permalink
chore(build): publish also on dockerhub
Browse files Browse the repository at this point in the history
  • Loading branch information
o-orand committed Mar 13, 2024
1 parent e7b5392 commit 1e51da1
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 @@ -12,6 +12,7 @@ on:
env:
DOCKER_FILE_PATH: "fly"
IMAGE: "ghcr.io/${{github.repository_owner}}/concourse-fly"
DOCKERHUB_ORG: elpaasoci
jobs:
build_and_publish:
name: build and publish
Expand All @@ -21,21 +22,34 @@ jobs:

steps:
- uses: actions/checkout@v4
-
name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
-
name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

-
name: extract github repo name
id: gh-repo-name
run: |
echo "OCI_IMAGE=$(basename ${{ github.repository }})" >> $GITHUB_ENV
shell: bash
-
name: publish image
uses: docker/[email protected]
with:
context: ${{env.DOCKER_FILE_PATH}}
push: true
tags: |
${{env.DOCKERHUB_ORG}}/${{env.OCI_IMAGE}}:latest
${{env.DOCKERHUB_ORG}}/${{env.OCI_IMAGE}}:${{github.sha}}
${{ env.IMAGE}}:latest
${{ env.IMAGE}}:${{github.sha}}
-
Expand All @@ -46,4 +60,5 @@ jobs:
push: true
context: ${{ env.DOCKER_FILE_PATH }}
tags: |
${{ env.IMAGE}}:${{github.ref_name}}
${{env.DOCKERHUB_ORG}}/${{env.OCI_IMAGE}}:${{github.ref_name}}
${{env.IMAGE}}:${{github.ref_name}}

0 comments on commit 1e51da1

Please sign in to comment.