Skip to content

Commit

Permalink
Update build-latest.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
InsertDisc authored Jan 9, 2024
1 parent fb2808a commit 3e3d928
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/build-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ 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 @@ -44,18 +52,15 @@ jobs:
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: ghcr.io/insertdisc/pattrmm:latest
cache-from: type=gha
cache-to: type=gha,mode=max
cache-from: type=local,src=/tmp/.docker
cache-to: type=local,dest=/tmp/.docker

- 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
Expand Down

0 comments on commit 3e3d928

Please sign in to comment.