Skip to content

Commit

Permalink
Update build-latest.yml
Browse files Browse the repository at this point in the history
Optimize process
  • Loading branch information
InsertDisc authored Jan 9, 2024
1 parent 3e3d928 commit cd317ec
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions .github/workflows/build-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,6 @@ jobs:
with:
ref: main

- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.docker
key: ${{ runner.os }}-docker-${{ hashFiles('**/Dockerfile') }}
restore-keys: |
${{ runner.os }}-docker-
- name: Login to GitHub Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

Expand All @@ -52,19 +44,23 @@ jobs:
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: ghcr.io/insertdisc/pattrmm:latest
cache-from: type=local,src=/tmp/.docker
cache-to: type=local,dest=/tmp/.docker
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}


- name: Pull image from GitHub Container Registry
run: docker pull ghcr.io/insertdisc/pattrmm:latest

- name: Tag for Docker Hub
run: |
docker tag ghcr.io/insertdisc/pattrmm:latest ${{ secrets.DOCKER_HUB_USERNAME }}/pattrmm:latest
- name: Push to Docker Hub
run: |
docker push ${{ secrets.DOCKER_HUB_USERNAME }}/pattrmm:latest

0 comments on commit cd317ec

Please sign in to comment.