Skip to content

1.38.3 (#323)

1.38.3 (#323) #893

Workflow file for this run

name: ci
on: [push, pull_request]
jobs:
build-bin:
name: bin
runs-on: ubuntu-22.04-xl
steps:
- name: Clone repository
uses: actions/checkout@v3
- name: Build and export image
run: |
docker build -f bin.dockerfile -t bin .
docker save bin -o /tmp/bin-image.tar
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: bin-image
path: /tmp/bin-image.tar
build:
needs: build-bin
name: ${{ matrix.kind }}
runs-on: ubuntu-22.04-xl
strategy:
matrix:
kind: ["alpine", "centos", "debian", "distroless", "ubuntu"]
steps:
- name: Clone repository
uses: actions/checkout@v3
- name: Download bin image artifact
uses: actions/download-artifact@v2
with:
name: bin-image
path: /tmp
- name: Load bin image
run: |
docker load --input /tmp/bin-image.tar
docker inspect bin
- name: Build image
run: |
docker build -f ${{ matrix.kind }}.dockerfile --build-arg BIN_IMAGE=bin -t ${{ matrix.kind }} .
- name: Test default CMD
run: |
docker run -t ${{ matrix.kind }}
- name: Test if entry script forwards to deno binary
run: |
docker run -t ${{ matrix.kind }} eval "console.log('Welcome to Deno!')"
# if typescript is present in the output, then probably deno --version worked
docker run -t ${{ matrix.kind }} --version | grep typescript
- name: Test if entry script forwards to other binaries
if: ${{ matrix.kind != 'distroless' }}
run: |
docker run -t ${{ matrix.kind }} deno eval "console.log('Welcome to Deno!')"
docker run -t ${{ matrix.kind }} echo 'test entry script'
- name: Login to Docker Hub
if: github.repository == 'denoland/deno_docker' && startsWith(github.ref, 'refs/tags/')
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Push named images
if: github.repository == 'denoland/deno_docker' && startsWith(github.ref, 'refs/tags/')
run: |
docker tag ${{ matrix.kind }} denoland/deno:${{ matrix.kind }}-${GITHUB_REF#refs/*/}
docker tag ${{ matrix.kind }} denoland/deno:${{ matrix.kind }}
docker push denoland/deno:${{ matrix.kind }}-${GITHUB_REF#refs/*/}
docker push denoland/deno:${{ matrix.kind }}
- name: Push bin image
if: github.repository == 'denoland/deno_docker' && startsWith(github.ref, 'refs/tags/') && matrix.kind == 'debian'
run: |
docker tag bin denoland/deno:bin-${GITHUB_REF#refs/*/}
docker tag bin denoland/deno:bin
docker push denoland/deno:bin-${GITHUB_REF#refs/*/}
docker push denoland/deno:bin
- name: Push default image
if: github.repository == 'denoland/deno_docker' && startsWith(github.ref, 'refs/tags/') && matrix.kind == 'debian'
run: |
docker tag ${{ matrix.kind }} denoland/deno:${GITHUB_REF#refs/*/}
docker tag ${{ matrix.kind }} denoland/deno:latest
docker push denoland/deno:${GITHUB_REF#refs/*/}
docker push denoland/deno:latest