Skip to content

Commit

Permalink
GitHub Actions: geração correta de manifest.
Browse files Browse the repository at this point in the history
  • Loading branch information
rbullajr committed May 9, 2024
1 parent b01ac97 commit 9183a0c
Showing 1 changed file with 52 additions and 13 deletions.
65 changes: 52 additions & 13 deletions .github/workflows/docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ on:
branches: [ "main" ]

env:
IMAGE_TAG: gh-${{github.run_number}}
IMAGE_TAG: amd64-gh-${{github.run_number}}
IMAGE_ARM_TAG: arm64-gh-${{github.run_number}}


jobs:
Expand Down Expand Up @@ -78,13 +79,9 @@ jobs:

- name: Publish images to ghcr.io
run: |
docker tag ghcr.io/larc-logs-transparentes/bu-service:${{env.IMAGE_TAG}} ghcr.io/larc-logs-transparentes/bu-service:latest
docker push --all-tags ghcr.io/larc-logs-transparentes/bu-service
docker tag ghcr.io/larc-logs-transparentes/back-pub:${{env.IMAGE_TAG}} ghcr.io/larc-logs-transparentes/back-pub:latest
docker push --all-tags ghcr.io/larc-logs-transparentes/back-pub
docker tag ghcr.io/larc-logs-transparentes/frontend:${{env.IMAGE_TAG}} ghcr.io/larc-logs-transparentes/frontend:latest
docker push --all-tags ghcr.io/larc-logs-transparentes/frontend
docker tag ghcr.io/larc-logs-transparentes/tlmanager:${{env.IMAGE_TAG}} ghcr.io/larc-logs-transparentes/tlmanager:latest
docker push --all-tags ghcr.io/larc-logs-transparentes/tlmanager
- name: Tag Repository logs-transparentes
Expand Down Expand Up @@ -116,22 +113,22 @@ jobs:
- name: Docker MacOS Image - BU Service
run: |
cd logs-transparentes/backend/bu_service
docker build . --file Dockerfile --tag ghcr.io/larc-logs-transparentes/bu-service:${{env.IMAGE_TAG}}
docker build . --file Dockerfile --tag ghcr.io/larc-logs-transparentes/bu-service:${{env.IMAGE_ARM_TAG}}
- name: Docker MacOS Image - Backend Public
run: |
cd logs-transparentes/backend/public
docker build . --file Dockerfile --tag ghcr.io/larc-logs-transparentes/back-pub:${{env.IMAGE_TAG}}
docker build . --file Dockerfile --tag ghcr.io/larc-logs-transparentes/back-pub:${{env.IMAGE_ARM_TAG}}
- name: Docker MacOS Image - Frontend
run: |
cd logs-transparentes/frontend_new
docker build . --file Dockerfile --tag ghcr.io/larc-logs-transparentes/frontend:${{env.IMAGE_TAG}}
docker build . --file Dockerfile --tag ghcr.io/larc-logs-transparentes/frontend:${{env.IMAGE_ARM_TAG}}
- name: Docker MacOS Image - TL Manager
run: |
cd logs-transparentes/tlmanager
docker build . --file Dockerfile --tag ghcr.io/larc-logs-transparentes/tlmanager:${{env.IMAGE_TAG}}
docker build . --file Dockerfile --tag ghcr.io/larc-logs-transparentes/tlmanager:${{env.IMAGE_ARM_TAG}}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
Expand All @@ -142,11 +139,53 @@ jobs:

- name: Publish MacOS images to ghcr.io
run: |
docker tag ghcr.io/larc-logs-transparentes/bu-service:${{env.IMAGE_TAG}} ghcr.io/larc-logs-transparentes/bu-service:latest
docker push --all-tags ghcr.io/larc-logs-transparentes/bu-service
docker tag ghcr.io/larc-logs-transparentes/back-pub:${{env.IMAGE_TAG}} ghcr.io/larc-logs-transparentes/back-pub:latest
docker push --all-tags ghcr.io/larc-logs-transparentes/back-pub
docker tag ghcr.io/larc-logs-transparentes/frontend:${{env.IMAGE_TAG}} ghcr.io/larc-logs-transparentes/frontend:latest
docker push --all-tags ghcr.io/larc-logs-transparentes/frontend
docker tag ghcr.io/larc-logs-transparentes/tlmanager:${{env.IMAGE_TAG}} ghcr.io/larc-logs-transparentes/tlmanager:latest
docker push --all-tags ghcr.io/larc-logs-transparentes/tlmanager
docker-manifest:
runs-on: ubuntu-latest
needs: publish-macos


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

- name: Create Docker manifest - BU Service
run: |
docker manifest create \
ghcr.io/larc-logs-transparentes/bu-service:latest \
--amend ghcr.io/larc-logs-transparentes/bu-service:${{env.IMAGE_ARM_TAG}} \
--amend ghcr.io/larc-logs-transparentes/bu-service:${{env.IMAGE_TAG}}
docker manifest push ghcr.io/larc-logs-transparentes/bu-service:latest
- name: Create Docker manifest - Backend Public
run: |
docker manifest create \
ghcr.io/larc-logs-transparentes/back-pub:latest \
--amend ghcr.io/larc-logs-transparentes/back-pub:${{env.IMAGE_ARM_TAG}} \
--amend ghcr.io/larc-logs-transparentes/back-pub:${{env.IMAGE_TAG}}
docker manifest push ghcr.io/larc-logs-transparentes/back-pub:latest
- name: Create Docker manifest - Frontend
run: |
docker manifest create \
ghcr.io/larc-logs-transparentes/frontend:latest \
--amend ghcr.io/larc-logs-transparentes/frontend:${{env.IMAGE_ARM_TAG}} \
--amend ghcr.io/larc-logs-transparentes/frontend:${{env.IMAGE_TAG}}
docker manifest push ghcr.io/larc-logs-transparentes/frontend:latest
- name: Create Docker manifest - TL Manager
run: |
docker manifest create \
ghcr.io/larc-logs-transparentes/tlmanager:latest \
--amend ghcr.io/larc-logs-transparentes/tlmanager:${{env.IMAGE_ARM_TAG}} \
--amend ghcr.io/larc-logs-transparentes/tlmanager:${{env.IMAGE_TAG}}
docker manifest push ghcr.io/larc-logs-transparentes/tlmanager:latest

0 comments on commit 9183a0c

Please sign in to comment.