Skip to content

Commit

Permalink
fix push. (#17)
Browse files Browse the repository at this point in the history
* fix push.

* fix push arch

* change job name.
  • Loading branch information
dojyorin authored Mar 18, 2024
1 parent 49917c4 commit 9286b79
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 50 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/_fetch.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@
"workflow_call": {
"outputs": {
"deno_version": {
"value": "${{jobs.fetch.outputs.deno_version}}"
"value": "${{jobs.job.outputs.deno_version}}"
}
}
}
},
"jobs": {
"fetch": {
"name": "fetch",
"job": {
"name": "deno version",
"runs-on": "ubuntu-latest",
"outputs": {
"deno_version": "${{steps.deno_version.outputs.value}}"
"deno_version": "${{steps.step.outputs.deno_version}}"
},
"steps": [{
"id": "deno_version",
"id": "step",
"name": "get deno latest version",
"run": "echo value=$(curl -Ls https://api.github.com/repos/denoland/deno/releases/latest | yq '.tag_name') >> ${{github.output}}"
"run": "echo deno_version=$(curl -Ls https://api.github.com/repos/denoland/deno/releases/latest | yq '.tag_name') >> ${{github.output}}"
}]
}
}
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/_fetch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ on:
workflow_call:
outputs:
deno_version:
value: ${{jobs.fetch.outputs.deno_version}}
value: ${{jobs.job.outputs.deno_version}}
jobs:
fetch:
name: fetch
job:
name: deno version
runs-on: ubuntu-latest
outputs:
deno_version: ${{steps.deno_version.outputs.value}}
deno_version: ${{steps.step.outputs.deno_version}}
steps:
- id: deno_version
- id: step
name: get deno latest version
run: echo value=$(curl -Ls https://api.github.com/repos/denoland/deno/releases/latest | yq '.tag_name') >> ${{github.output}}
run: echo deno_version=$(curl -Ls https://api.github.com/repos/denoland/deno/releases/latest | yq '.tag_name') >> ${{github.output}}
22 changes: 6 additions & 16 deletions .github/workflows/_push.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,18 @@
}
},
"jobs": {
"push": {
"name": "push: ${{matrix.distro}}/${{matrix.arch}}",
"job": {
"name": "${{matrix.os}}",
"runs-on": "ubuntu-latest",
"strategy": {
"fail-fast": true,
"matrix": {
"distro": [
"os": [
"alpine",
"distroless"
],
"arch": [
"amd64",
"arm64"
]
}
},
"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 @@ -53,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) || ''}}",
"platforms": "linux/${{matrix.arch}}",
"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
20 changes: 6 additions & 14 deletions .github/workflows/_push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,15 @@ on:
type: string
required: true
jobs:
push:
name: 'push: ${{matrix.distro}}/${{matrix.arch}}'
job:
name: ${{matrix.os}}
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
distro:
os:
- alpine
- distroless
arch:
- amd64
- arm64
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 @@ -39,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) || ''}}
platforms: linux/${{matrix.arch}}
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}}
8 changes: 4 additions & 4 deletions .github/workflows/_test.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
}
},
"jobs": {
"test": {
"name": "test: ${{matrix.distro}}/${{matrix.arch}}",
"job": {
"name": "${{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
8 changes: 4 additions & 4 deletions .github/workflows/_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ on:
type: string
required: true
jobs:
test:
name: 'test: ${{matrix.distro}}/${{matrix.arch}}'
job:
name: ${{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 9286b79

Please sign in to comment.