Skip to content

Commit

Permalink
Feature/release2 docker hub issue 101 (#103)
Browse files Browse the repository at this point in the history
* Create release-dockerhub-images.yml for #101

* Merge instructions from release-dockerhub-images.yml

* Delete .github/workflows/.github/workflows/release-dockerhub-images.yml
  • Loading branch information
NewJerseyStyle authored Dec 6, 2024
1 parent 1263228 commit e40935c
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions .github/workflows/release-docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,34 @@ jobs:
with:
ref: ${{ steps.extract_branch.outputs.branch }}

- name: Login to Docker Hub
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.CR_PAT }}

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Build full project via docker-compose
run: |
mv example.env .env
sed -i 's/docker.io/ghcr.io/g' docker-compose.yml
sed -i 's/compdem/civictechto/g' docker-compose.yml
docker compose --profile postgres build --parallel --build-arg GIT_HASH=${GITHUB_SHA:0:6}
- name: Push images to Docker Hub
- name: Push images to GHCR
run: docker compose --profile postgres push --ignore-push-failures

- name: Push images to Docker Hub
run: |
for image in $(docker images --format='{{.Repository}}:{{.Tag}}'); do
IMAGE_NAME=$(echo "$image" | sed 's/ghcr.io/docker.io/g')
IMAGE_NAME=$(echo "$IMAGE_NAME" | sed 's/civictechto/${{ secrets.DOCKER_USERNAME }}/g')
docker tag $image $IMAGE_NAME
done
docker compose --profile postgres push --ignore-push-failures

0 comments on commit e40935c

Please sign in to comment.