chore: release 0.8.3 (#95) #180
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: docker | |
on: | |
push: | |
branches: ["main"] | |
tags: ["[0-9]+.[0-9]+.[0-9]+"] | |
pull_request: | |
branches: ["main"] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
contents: read | |
steps: | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
- name: Set up QEMU (for multi-platform builds) | |
uses: docker/setup-qemu-action@v2 | |
- name: Clone repository | |
uses: actions/checkout@v3 | |
- name: Cache Docker layers | |
uses: actions/cache@v3 | |
with: | |
path: /tmp/.buildx-cache | |
key: ${{ runner.os }}-buildx-${{ github.sha }} | |
restore-keys: | | |
${{ runner.os }}-buildx- | |
- name: Build amd64 image for testing | |
run: | | |
docker buildx create --use | |
docker buildx build --platform linux/amd64 \ | |
--tag denokv:test \ | |
--output type=docker . | |
- name: Smoke test image | |
run: | | |
docker run --platform linux/amd64 -i --init denokv:test --help | |
- name: Log in to ghcr.io | |
if: github.repository == 'denoland/denokv' && startsWith(github.ref, 'refs/tags/') | |
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin | |
- name: Build and push multi-platform image | |
if: github.repository == 'denoland/denokv' && startsWith(github.ref, 'refs/tags/') | |
run: | | |
docker buildx build --platform linux/amd64,linux/arm64 \ | |
--tag ghcr.io/denoland/denokv:${GITHUB_REF#refs/*/} \ | |
--tag ghcr.io/denoland/denokv:latest \ | |
--push . |