build(deps): bump denoland/setup-deno from 1 to 2 #170
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [ main ] | |
tags: [ v* ] | |
paths-ignore: | |
- 'helm-chart/**' | |
- 'manifests/**' | |
- 'configs/**' | |
- '*.md' | |
pull_request: {} | |
jobs: | |
check: | |
runs-on: ubuntu-latest | |
name: Check w/ ${{ matrix.deno-version }} | |
strategy: | |
matrix: | |
deno-version: | |
- v1.25 | |
- v1.30 | |
- v1.35 | |
- v1.40 | |
- canary | |
fail-fast: false # run each branch to completion | |
steps: | |
- name: Checkout source | |
uses: actions/checkout@v4 | |
- name: Use Deno ${{ matrix.deno-version }} | |
uses: denoland/setup-deno@v2 | |
with: | |
deno-version: ${{ matrix.deno-version }} | |
# "https" cache: code from the Internet | |
# External sources won't change much so we use less precise keys | |
- name: Cache https:// | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/deno/deps/https | |
key: deno-https/v1-${{ github.sha }} | |
restore-keys: deno-https/v1- | |
- name: Check src/main.ts | |
if: always() | |
run: time deno check src/main.ts | |
- name: Run test suite | |
if: always() | |
run: time deno test | |
# Push image to GitHub Packages. | |
# See also https://docs.docker.com/docker-hub/builds/ | |
push: | |
needs: check | |
runs-on: ubuntu-latest | |
name: 'Push container image' | |
if: github.event_name == 'push' | |
steps: | |
- name: Use Deno stable | |
uses: denoland/setup-deno@v2 | |
with: | |
deno-version: v1.40 | |
- name: Cache https:// | |
uses: actions/cache@v4 | |
with: | |
path: ~/.cache/deno/deps/https | |
key: deno-https/v1-${{ github.sha }}-doci | |
restore-keys: deno-https/v1- | |
- name: Install denodir-oci utility | |
run: deno install --allow-{read,write}=$HOME,${TMPDIR:-/tmp} --allow-run --allow-net --allow-env --reload=https://raw.githubusercontent.com https://raw.githubusercontent.com/cloudydeno/denodir-oci/main/doci/mod.ts | |
- name: Determine image name | |
id: name | |
run: | | |
IMAGE_ID=ghcr.io/cloudydeno/dns-sync | |
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]') | |
if [[ "${{ github.ref }}" == "refs/tags/"* ]] | |
then VERSION=$( echo $VERSION | sed -e 's/^v//' ) | |
else VERSION=$( echo ${{ github.sha }} | cut -c1-7 ) | |
fi | |
echo "Will push to $IMAGE_ID:$VERSION" | |
echo "::set-output name=image::$IMAGE_ID" | |
echo "::set-output name=tag::$VERSION" | |
- name: Log into GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: x-access-token | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/checkout@v4 | |
- name: Build denodir | |
run: doci pipeline build | |
# - name: Push denodir image | |
# run: doci pipeline push --tag ${{ steps.name.outputs.tag }} --target denodir | |
- name: Push alpine image | |
run: doci pipeline push --tag ${{ steps.name.outputs.tag }} --target alpine | |
- name: Push multiarch image | |
run: doci pipeline push --tag ${{ steps.name.outputs.tag }} --target multiarch |