diff --git a/.github/workflows/_fetch.json b/.github/workflows/_fetch.json index 197725c..500577f 100644 --- a/.github/workflows/_fetch.json +++ b/.github/workflows/_fetch.json @@ -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}}" }] } } diff --git a/.github/workflows/_fetch.yaml b/.github/workflows/_fetch.yaml index 6fb8b3d..c6f0a41 100644 --- a/.github/workflows/_fetch.yaml +++ b/.github/workflows/_fetch.yaml @@ -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}} \ No newline at end of file + run: echo deno_version=$(curl -Ls https://api.github.com/repos/denoland/deno/releases/latest | yq '.tag_name') >> ${{github.output}} \ No newline at end of file diff --git a/.github/workflows/_push.json b/.github/workflows/_push.json index 21e9324..a8416dc 100644 --- a/.github/workflows/_push.json +++ b/.github/workflows/_push.json @@ -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" @@ -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}}" } }] diff --git a/.github/workflows/_push.yaml b/.github/workflows/_push.yaml index f6b87a7..b35b896 100644 --- a/.github/workflows/_push.yaml +++ b/.github/workflows/_push.yaml @@ -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 @@ -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}} \ No newline at end of file diff --git a/.github/workflows/_test.json b/.github/workflows/_test.json index 23b821e..41fbc3b 100644 --- a/.github/workflows/_test.json +++ b/.github/workflows/_test.json @@ -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" ], @@ -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}}" } }, { diff --git a/.github/workflows/_test.yaml b/.github/workflows/_test.yaml index 9d77f51..997589e 100644 --- a/.github/workflows/_test.yaml +++ b/.github/workflows/_test.yaml @@ -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: @@ -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()' \ No newline at end of file