Skip to content

Commit

Permalink
Build
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisBellew committed May 26, 2024
1 parent 115fbc3 commit 5d6da9b
Showing 1 changed file with 28 additions and 6 deletions.
34 changes: 28 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,30 @@ jobs:
group: build-${{ matrix.os }}
strategy:
matrix:
os: [self-hosted] #ubuntu-latest,
os: [ubuntu-latest] #self-hosted,
include:
# - os: ubuntu-latest
# architecture: amd64
- os: self-hosted
architecture: arm64
- os: ubuntu-latest
architecture: amd64
# - os: self-hosted
# architecture: arm64

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
install: true

- name: Cache Docker layers
id: docker-cache
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ matrix.os }}-${{ matrix.architecture }}
restore-keys: |
${{ runner.os }}-buildx-${{ matrix.os }}-${{ matrix.architecture }}
- name: Login to Docker Hub
uses: docker/login-action@v2
Expand All @@ -44,7 +55,18 @@ jobs:
# Build pg-ferret image
- name: Build Docker image with pg-ferret-postgres-16 base
run: |
docker buildx build --platform linux/${{ matrix.architecture }} --tag ${{ secrets.DOCKER_USERNAME }}/pg-ferret:latest --push .
docker buildx build \
--platform linux/${{ matrix.architecture }} \
--cache-from type=local,src=/tmp/.buildx-cache \
--cache-to type=local,dest=/tmp/.buildx-cache-new \
--tag ${{ secrets.DOCKER_USERNAME }}/pg-ferret:latest \
--push .
- name: Update Docker cache
if: success()
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache
- name: Logout from Docker Hub
run: docker logout

0 comments on commit 5d6da9b

Please sign in to comment.