Skip to content

Commit

Permalink
More fixed to caching and general build
Browse files Browse the repository at this point in the history
  • Loading branch information
maoueh committed Jul 10, 2024
1 parent c8c9246 commit df78cf0
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions .github/workflows/docker_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,34 +29,32 @@ jobs:
- name: Display the version of go that we have installed
run: go version

- uses: actions/cache@v4
- name: Restore cached Go build & dependencies
id: cache-restore
uses: actions/cache/restore@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
save-always: true
- name: Compile the binary
run: |
# Ensure we get something to describe....
git fetch --tags
make install
mkdir /root/build
cp "`go env GOPATH`/bin/seid" /root/build/seid
mkdir ~/build
cp "`go env GOPATH`/bin/seid" ~/build/seid
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
uses: docker/setup-qemu-action@v3

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

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
Expand All @@ -78,7 +76,17 @@ jobs:
uses: docker/build-push-action@v4
with:
file: Dockerfile.sf
context: /root/build
context: ~/build
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Always Save Go build & dependencies
id: cache-save
if: always() && steps.cache-restore.outputs.cache-hit != 'true'
uses: actions/cache/save@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}

0 comments on commit df78cf0

Please sign in to comment.