Skip to content

Commit

Permalink
Fix ipfs credential (#242)
Browse files Browse the repository at this point in the history
* Fix ipfs credential for docker image

* Fix ipfs credential for aur package

* Refine docker buildx inherits
  • Loading branch information
waybackarchiver authored Nov 2, 2022
1 parent 70d4b27 commit 8890c77
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 18 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ jobs:
- name: Build and push Docker image
uses: docker/bake-action@fb56172975f3a7f62d2defb5d32d735a2eaa41eb # v2.0.0
env:
WAYBACK_IPFS_APIKEY: ${{ secrets.WAYBACK_IPFS_APIKEY }}
with:
files: |
./docker-bake.hcl
Expand Down Expand Up @@ -197,6 +199,8 @@ jobs:
- name: Build and push Docker image
uses: docker/bake-action@fb56172975f3a7f62d2defb5d32d735a2eaa41eb # v2.0.0
env:
WAYBACK_IPFS_APIKEY: ${{ secrets.WAYBACK_IPFS_APIKEY }}
with:
files: |
./docker-bake.hcl
Expand Down
4 changes: 4 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ COPY --from=tonistiigi/xx:golang / /
RUN apk add --no-cache -U build-base ca-certificates linux-headers musl-dev git tar

ARG TARGETPLATFORM
ARG WAYBACK_IPFS_APIKEY

WORKDIR /src

ENV WAYBACK_IPFS_APIKEY ${WAYBACK_IPFS_APIKEY}

COPY . .
RUN --mount=type=bind,target=/src,rw \
--mount=type=cache,target=/root/.cache/go-build \
Expand Down
2 changes: 1 addition & 1 deletion build/aur
Submodule aur updated 1 files
+1 −3 Dockerfile
34 changes: 17 additions & 17 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,19 @@ variable "GO_VERSION" {
default = "1.19"
}

target "go-version" {
args = {
GO_VERSION = GO_VERSION
}
variable "WAYBACK_IPFS_APIKEY" {
default = ""
}

// GitHub reference as defined in GitHub Actions (eg. refs/head/master))
variable "GITHUB_REF" {
default = ""
}

target "git-ref" {
target "_common" {
args = {
GIT_REF = GITHUB_REF
GO_VERSION = GO_VERSION
WAYBACK_IPFS_APIKEY = WAYBACK_IPFS_APIKEY
}
}

Expand All @@ -29,7 +28,17 @@ target "docker-metadata-action" {
tags = ["wabarc/wayback:local"]
}

target "image" {
inherits = ["_common", "docker-metadata-action"]
}

target "image-local" {
inherits = ["image"]
output = ["type=docker"]
}

target "artifact" {
inherits = ["image"]
output = ["./dist"]
}

Expand All @@ -46,17 +55,8 @@ target "artifact-all" {
]
}

target "image" {
inherits = ["docker-metadata-action"]
}

target "image-local" {
inherits = ["image"]
output = ["type=docker"]
}

target "release" {
inherits = ["docker-metadata-action"]
inherits = ["image"]
context = "./"
platforms = [
"linux/386",
Expand All @@ -70,7 +70,7 @@ target "release" {
}

target "bundle" {
inherits = ["docker-metadata-action"]
inherits = ["image"]
context = "./"
dockerfile = "./build/docker/Dockerfile.all"
platforms = [
Expand Down

0 comments on commit 8890c77

Please sign in to comment.