Skip to content

Commit

Permalink
Update cicd.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
gilmaimon authored Jul 26, 2024
1 parent 94868f3 commit eeeba0f
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions .github/workflows/cicd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,17 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build Docker image
run: docker build -t server:latest .
- name: Build and export
uses: docker/build-push-action@v6
with:
tags: server:latest
outputs: type=docker,dest=/tmp/myimage.tar

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: myimage
path: /tmp/myimage.tar

deploy:
needs: build # Ensure deploy job waits for build job
Expand All @@ -30,6 +39,17 @@ jobs:
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}


- name: Download artifact
uses: actions/download-artifact@v4
with:
name: myimage
path: /tmp

- name: Load image
run: |
docker load --input /tmp/myimage.tar
docker image ls -a
- name: Push Docker image
run: docker push server:latest

0 comments on commit eeeba0f

Please sign in to comment.