Skip to content

Commit

Permalink
fix push arch
Browse files Browse the repository at this point in the history
  • Loading branch information
dojyorin committed Mar 18, 2024
1 parent 3fbe0d4 commit d6d489d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 25 deletions.
14 changes: 4 additions & 10 deletions .github/workflows/_push.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,17 @@
},
"jobs": {
"push": {
"name": "push: ${{matrix.distro}}",
"name": "push: ${{matrix.os}}",
"runs-on": "ubuntu-latest",
"strategy": {
"fail-fast": true,
"matrix": {
"distro": [
"os": [
"alpine",
"distroless"
]
}
},
"env": {
"tag_f": "dojyorin/deno:${{matrix.distro}}-${{inputs.deno_version}}",
"tag_d": "dojyorin/deno:${{matrix.distro}}",
"tag_v": "dojyorin/deno:${{inputs.deno_version}}",
"tag_l": "dojyorin/deno:latest"
},
"steps": [{
"name": "clone repository",
"uses": "actions/checkout@v4"
Expand All @@ -49,10 +43,10 @@
"push": true,
"pull": true,
"no-cache": true,
"tags": "${{env.tag_f}},${{env.tag_d}}${{matrix.distro == 'distroless' && format(',{0},{1}', env.tag_v, env.tag_l) || ''}}",
"tags": "${{github.repository_owner}}/deno:${{matrix.os}}-${{inputs.deno_version}},${{github.repository_owner}}/deno:${{matrix.os}},${{matrix.os == 'distroless' && format('{0}/deno:{1},{0}/deno:latest', github.repository_owner, inputs.deno_version) || ''}}",
"platforms": "linux/amd64,linux/arm64",
"context": "{{defaultContext}}:./src",
"file": "${{matrix.distro}}.dockerfile",
"file": "${{matrix.os}}.dockerfile",
"build-args": "DENO_VERSION=${{inputs.deno_version}}"
}
}]
Expand Down
13 changes: 4 additions & 9 deletions .github/workflows/_push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,14 @@ on:
required: true
jobs:
push:
name: 'push: ${{matrix.distro}}'
name: 'push: ${{matrix.os}}'
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
distro:
os:
- alpine
- distroless
env:
tag_f: dojyorin/deno:${{matrix.distro}}-${{inputs.deno_version}}
tag_d: dojyorin/deno:${{matrix.distro}}
tag_v: dojyorin/deno:${{inputs.deno_version}}
tag_l: dojyorin/deno:latest
steps:
- name: clone repository
uses: actions/checkout@v4
Expand All @@ -36,8 +31,8 @@ jobs:
push: true
pull: true
no-cache: true
tags: ${{env.tag_f}},${{env.tag_d}}${{matrix.distro == 'distroless' && format(',{0},{1}', env.tag_v, env.tag_l) || ''}}
tags: ${{github.repository_owner}}/deno:${{matrix.os}}-${{inputs.deno_version}},${{github.repository_owner}}/deno:${{matrix.os}},${{matrix.os == 'distroless' && format('{0}/deno:{1},{0}/deno:latest', github.repository_owner, inputs.deno_version) || ''}}
platforms: linux/amd64,linux/arm64
context: '{{defaultContext}}:./src'
file: ${{matrix.distro}}.dockerfile
file: ${{matrix.os}}.dockerfile
build-args: DENO_VERSION=${{inputs.deno_version}}
6 changes: 3 additions & 3 deletions .github/workflows/_test.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
},
"jobs": {
"test": {
"name": "test: ${{matrix.distro}}/${{matrix.arch}}",
"name": "test: ${{matrix.os}}/${{matrix.arch}}",
"runs-on": "ubuntu-latest",
"strategy": {
"fail-fast": true,
"matrix": {
"distro": [
"os": [
"alpine",
"distroless"
],
Expand All @@ -42,7 +42,7 @@
"tags": "${{github.sha}}",
"platforms": "linux/${{matrix.arch}}",
"context": "{{defaultContext}}:./src",
"file": "${{matrix.distro}}.dockerfile",
"file": "${{matrix.os}}.dockerfile",
"build-args": "DENO_VERSION=${{inputs.deno_version}}"
}
}, {
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ on:
required: true
jobs:
test:
name: 'test: ${{matrix.distro}}/${{matrix.arch}}'
name: 'test: ${{matrix.os}}/${{matrix.arch}}'
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
distro:
os:
- alpine
- distroless
arch:
Expand All @@ -31,7 +31,7 @@ jobs:
tags: ${{github.sha}}
platforms: linux/${{matrix.arch}}
context: '{{defaultContext}}:./src'
file: ${{matrix.distro}}.dockerfile
file: ${{matrix.os}}.dockerfile
build-args: DENO_VERSION=${{inputs.deno_version}}
- name: test image
run: docker run --rm --init --platform linux/${{matrix.arch}} ${{github.sha}} eval -p 'new Date()'

0 comments on commit d6d489d

Please sign in to comment.