mirror of
https://github.com/rtmmbarbosa/registry-console.git
synced 2025-12-21 12:39:57 -06:00
✅ Final: Configure Docker Hub deployment
- Configure workflow for Docker Hub (rubenmacedobarbosa/registry-console) - Update GitHub secrets instructions with specific username - Ready for Docker Hub authentication setup - Test-first CI/CD pipeline ready to deploy Next steps: 1. Add DOCKER_USERNAME and DOCKER_PASSWORD secrets on GitHub 2. Push to trigger automated build and deployment
This commit is contained in:
9
.github/workflows/build-package.yml
vendored
9
.github/workflows/build-package.yml
vendored
@@ -39,13 +39,12 @@ jobs:
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Log in to GitHub Container Registry
|
||||
- name: Log in to Docker Hub
|
||||
if: github.event_name != 'pull_request'
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v5
|
||||
@@ -53,4 +52,4 @@ jobs:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ghcr.io/${{ github.repository }}:latest
|
||||
tags: ${{ secrets.DOCKER_USERNAME }}/registry-console:latest
|
||||
59
github-secrets-setup.md
Normal file
59
github-secrets-setup.md
Normal file
@@ -0,0 +1,59 @@
|
||||
# GitHub Actions Secrets Setup
|
||||
|
||||
Para o workflow funcionar corretamente, precisas configurar os seguintes secrets no GitHub:
|
||||
|
||||
## 1. Aceder às Settings do Repository
|
||||
|
||||
1. Vai ao teu repositório: `https://github.com/rtmmbarbosa/registry-console`
|
||||
2. Clica em **Settings** (tab no topo)
|
||||
3. Na barra lateral esquerda, clica em **Secrets and variables** > **Actions**
|
||||
|
||||
## 2. Adicionar os Secrets
|
||||
|
||||
Clica em **New repository secret** e adiciona:
|
||||
|
||||
### DOCKER_USERNAME
|
||||
- **Name**: `DOCKER_USERNAME`
|
||||
- **Value**: `rubenmacedobarbosa` (o teu username do Docker Hub)
|
||||
|
||||
### DOCKER_PASSWORD
|
||||
- **Name**: `DOCKER_PASSWORD`
|
||||
- **Value**: `[a tua password do Docker Hub]`
|
||||
|
||||
**Nota**: Se usares 2FA no Docker Hub, precisas criar um Access Token em vez da password:
|
||||
1. Vai a Docker Hub > Account Settings > Security > Access Tokens
|
||||
2. Cria um novo token com permissões de Read & Write
|
||||
3. Usa esse token como `DOCKER_PASSWORD`
|
||||
|
||||
**Para ti (rubenmacedobarbosa@gmail.com):**
|
||||
- O teu username do Docker Hub é provavelmente `rubenmacedobarbosa`
|
||||
- Se não tiveres conta no Docker Hub, cria uma em https://hub.docker.com
|
||||
|
||||
## 3. Verificar os Secrets
|
||||
|
||||
Após adicionar, deves ver na lista:
|
||||
- `DOCKER_USERNAME`
|
||||
- `DOCKER_PASSWORD`
|
||||
|
||||
## 4. Workflow Atualizado
|
||||
|
||||
O workflow agora:
|
||||
- Usa o Docker Hub (registry público gratuito)
|
||||
- Faz push para `rubenmacedobarbosa/registry-console:latest`
|
||||
- Mantém todos os testes antes do build
|
||||
- Funciona sem problemas de permissões
|
||||
|
||||
## 5. Próximo Push
|
||||
|
||||
Quando fizeres o próximo push, o workflow:
|
||||
1. Executa os testes
|
||||
2. Se testes passarem, faz build
|
||||
3. Faz push para o Docker Hub
|
||||
|
||||
**Benefícios do Docker Hub:**
|
||||
- ✅ Gratuito para repositórios públicos
|
||||
- ✅ Sem problemas de permissões organizacionais
|
||||
- ✅ Amplamente usado pela comunidade
|
||||
- ✅ Fácil de usar por outros developers
|
||||
|
||||
A imagem ficará disponível em: `docker pull rubenmacedobarbosa/registry-console:latest` 🎉
|
||||
Reference in New Issue
Block a user