Skip to content

Commit

Permalink
modify image names
Browse files Browse the repository at this point in the history
  • Loading branch information
Hamada Gasmallah committed Jan 21, 2023
1 parent e2db926 commit 388c25c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
file: ./backend/Dockerfile
platforms: linux/arm64,linux/amd64
push: true
tags: ghcr.io/hamada-distributed/k8s-toyapp:backend-${{ github.sha }}
tags: ghcr.io/hamada-distributed/k8s-toyapp-backend:${{ github.sha }}
tests:
name: "backend:test"
runs-on: ubuntu-latest
Expand All @@ -44,15 +44,23 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pull and run tests
run: |
docker pull ghcr.io/hamada-distributed/k8s-toyapp:backend-${{ github.sha }}
docker run -d -p 8080:8080 -e APP_PORT=8080 ghcr.io/hamada-distributed/k8s-toyapp:backend-${{ github.sha }}
docker pull ghcr.io/hamada-distributed/k8s-toyapp-backend:${{ github.sha }}
docker run -d -p 8080:8080 -e APP_PORT=8080 ghcr.io/hamada-distributed/k8s-toyapp-backend:${{ github.sha }}
sleep 10
curl localhost:8080/api/status
exit $?
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- uses: docker/build-push-action@v3
with:
context: ./backend
file: ./backend/Dockerfile
platforms: linux/arm64,linux/amd64
push: true
tags: ghcr.io/hamada-distributed/k8s-toyapp:backend
tags: ghcr.io/hamada-distributed/k8s-toyapp-backend:${{ steps.date.outputs.date }}
- uses: actions/delete-package-versions@v4
with:
package-name: k8s-toyapp-backend
package-type: container
min-versions-to-keep: 6
16 changes: 12 additions & 4 deletions .github/workflows/frontend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
file: ./frontend/Dockerfile
platforms: linux/arm64,linux/amd64
push: true
tags: ghcr.io/hamada-distributed/k8s-toyapp:frontend-${{ github.sha }}
tags: ghcr.io/hamada-distributed/k8s-toyapp-frontend:${{ github.sha }}
test:
name: "frontend:test"
runs-on: ubuntu-latest
Expand All @@ -44,15 +44,23 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}
- name: Pull and test image
run: |
docker pull ghcr.io/hamada-distributed/k8s-toyapp:frontend-${{ github.sha }}
docker run -d -p 8000:8000 ghcr.io/hamada-distributed/k8s-toyapp:frontend-${{ github.sha }}
docker pull ghcr.io/hamada-distributed/k8s-toyapp-frontend:${{ github.sha }}
docker run -d -p 8000:8000 ghcr.io/hamada-distributed/k8s-toyapp-frontend:${{ github.sha }}
sleep 10
curl localhost:8000/
exit $?
- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
- uses: docker/build-push-action@v2
with:
context: ./frontend
file: ./frontend/Dockerfile
platforms: linux/arm64,linux/amd64
push: true
tags: ghcr.io/hamada-distributed/k8s-toyapp:frontend
tags: ghcr.io/hamada-distributed/k8s-toyapp-frontend:${{ steps.date.outputs.date }}
- uses: actions/delete-package-versions@v4
with:
package-name: k8s-toyapp-frontend
package-type: container
min-versions-to-keep: 6

0 comments on commit 388c25c

Please sign in to comment.