Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/release2 docker hub issue 101 #103

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading