Skip to content

Commit 5e177cb

Browse files
committed
Update bica-ci.yml
1 parent fb2f316 commit 5e177cb

1 file changed

Lines changed: 26 additions & 7 deletions

File tree

.github/workflows/bica-ci.yml

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: BICA Backup CI
1+
name: BICA Backup CI/CD
22

33
on:
44
push:
@@ -31,16 +31,16 @@ jobs:
3131
--health-retries 5
3232
3333
steps:
34-
- name: 📥 Checkout repo
34+
- name: Checkout repo
3535
uses: actions/checkout@v4
3636

37-
- name: 🐳 Setup Docker Buildx
37+
- name: Setup Docker Buildx
3838
uses: docker/setup-buildx-action@v3
3939

40-
- name: 🛠️ Build backup container
40+
- name: Build backup container
4141
run: docker build -t $IMAGE_NAME:$TAG .
4242

43-
- name: 📦 Run backup script test
43+
- name: Run backup script test
4444
run: |
4545
mkdir -p ./backups
4646
docker run --rm \
@@ -50,12 +50,31 @@ jobs:
5050
-e DB_PASSWORD=testpass \
5151
-e DB_NAME=testdb \
5252
-e BACKUP_DIR=/mnt/backups \
53-
-e RETENTION_DAYS=1 \
53+
-e RETENTION_DAYS=7 \
5454
-e ENCRYPT=false \
5555
-v $(pwd)/backups:/mnt/backups \
5656
$IMAGE_NAME:$TAG /backup.sh
5757
58-
- name: Check backup created
58+
- name: Check backup created
5959
run: |
6060
ls -lh ./backups
6161
test -f ./backups/*.tar.gz || (echo "❌ Backup não foi criado!" && exit 1)
62+
63+
docker-publish:
64+
name: Push to Docker Hub
65+
runs-on: ubuntu-latest
66+
needs: build-and-test
67+
steps:
68+
- uses: actions/checkout@v4
69+
70+
- name: Docker Login
71+
uses: docker/login-action@v3
72+
with:
73+
username: ${{ secrets.DOCKER_USERNAME }}
74+
password: ${{ secrets.DOCKER_PASSWORD }}
75+
76+
- name: 🚢 Push image
77+
run: |
78+
docker tag $IMAGE_NAME:$TAG ${{ secrets.DOCKER_USERNAME }}/$IMAGE_NAME:latest
79+
docker push ${{ secrets.DOCKER_USERNAME }}/$IMAGE_NAME:latest
80+

0 commit comments

Comments
 (0)