Skip to content

GitHub Actions: instalar docker no MacOS-16. #7

GitHub Actions: instalar docker no MacOS-16.

GitHub Actions: instalar docker no MacOS-16. #7

Workflow file for this run

name: Teste-MacOS
on:
push:
branches: [ "docker-macos" ]
env:
IMAGE_TAG: gh-${{github.run_number}}
jobs:
publish-macos:
runs-on: macOS-latest
steps:
- name: Download logs-transparentes source
uses: actions/checkout@v4
with:
repository: 'larc-logs-transparentes/logs-transparentes'
path: 'logs-transparentes'
- name: Install Docker
run: |
brew install colima
brew install --cask docker
brew services start colima
export DOCKER_HOST=unix:///$HOME/.colima/docker.sock
#brew install --cask docker
#brew services restart colima
# For testcontainers to find the Colima socket
# https://github.com/abiosoft/colima/blob/main/docs/FAQ.md#cannot-connect-to-the-docker-daemon-at-unixvarrundockersock-is-the-docker-daemon-running
#sudo ln -sf $HOME/.colima/default/docker.sock /var/run/docker.sock
#docker context use colima
docker ps -a
docker info
- 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}}
- 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}}
- 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}}
- 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}}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Publish MacOS images to ghcr.io
run: |
docker tag ghcr.io/larc-logs-transparentes/bu-service:${{env.IMAGE_TAG}}
docker push --all-tags ghcr.io/larc-logs-transparentes/bu-service
docker tag ghcr.io/larc-logs-transparentes/back-pub:${{env.IMAGE_TAG}}
docker push --all-tags ghcr.io/larc-logs-transparentes/back-pub
docker tag ghcr.io/larc-logs-transparentes/frontend:${{env.IMAGE_TAG}}
docker push --all-tags ghcr.io/larc-logs-transparentes/frontend
docker tag ghcr.io/larc-logs-transparentes/tlmanager:${{env.IMAGE_TAG}}
docker push --all-tags ghcr.io/larc-logs-transparentes/tlmanager