chore: release (#235) #16
Workflow file for this run
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: | |
tags: | |
- 'moq-relay-v*' | |
- 'moq-karp-v*' | |
- 'moq-clock-v*' | |
env: | |
REGISTRY: docker.io/kixelated | |
jobs: | |
deploy: | |
name: Publish Docker Image | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
id-token: write | |
steps: | |
- uses: actions/checkout@v3 | |
# Figure out the docker image based on the tag | |
- id: parse | |
run: | | |
ref=${GITHUB_REF#refs/tags/} | |
if [[ "$ref" =~ ^(moq-[a-z]+)-v([0-9.]+)$ ]]; then | |
target=${BASH_REMATCH[1]} | |
version=${BASH_REMATCH[2]} | |
echo "target=$target" >> $GITHUB_OUTPUT | |
echo "version=$version" >> $GITHUB_OUTPUT | |
else | |
echo "Tag format not recognized." >&2 | |
exit 1 | |
fi | |
# I'm paying for Depot for faster ARM builds. | |
- uses: depot/setup-action@v1 | |
# Login to docker.io | |
- uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKER_USERNAME }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
# Build and push Docker image with Depot | |
- uses: depot/build-push-action@v1 | |
with: | |
project: r257ctfqm6 | |
context: . | |
push: true | |
target: ${{ steps.parse.outputs.target }} | |
tags: | | |
${{ env.REGISTRY }}/${{ steps.parse.outputs.target }}:${{ steps.parse.outputs.version }} | |
${{ env.REGISTRY }}/${{ steps.parse.outputs.target }}:latest | |
platforms: linux/amd64,linux/arm64 |