Skip to content

Commit

Permalink
fix workflow: revert to original structure without caching
Browse files Browse the repository at this point in the history
  • Loading branch information
Songmin17 committed Nov 22, 2023
1 parent e851eb2 commit f8c8af9
Showing 1 changed file with 4 additions and 27 deletions.
31 changes: 4 additions & 27 deletions .github/workflows/docker_build_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,37 +16,14 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
run: echo "${{ secrets.DOCKER_PASSWORD }}" | docker login -u "${{ secrets.DOCKER_USERNAME }}" --password-stdin

- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: ./backend
file: ./backend/Dockerfile
tags: ${{ secrets.DOCKER_USERNAME }}/haengsha-backend:latest
push: true
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new

- name: Move Docker cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
cd backend
docker build -t "${{ secrets.DOCKER_USERNAME }}/haengsha-backend:latest" .
docker push "${{ secrets.DOCKER_USERNAME }}/haengsha-backend:latest"
- name: Deploy to EC2
run: |
Expand Down

0 comments on commit f8c8af9

Please sign in to comment.