Skip to content

Tweak README

Tweak README #4

Workflow file for this run

name: Build & Publish
on:
push:
branches: [main]
pull_request:
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v6
with:
context: .
load: true
tags: xtide:test
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Test
run: ./test.sh xtide:test
- name: Extract versions from Dockerfile
if: github.event_name == 'push'
id: versions
run: |
xtide=$(grep -oP '^ARG XTIDE_VERSION=\K.+' Dockerfile)
harmonics=$(grep -oP '^ARG HARMONICS_VERSION=\K.+' Dockerfile)
echo "xtide=$xtide" >> "$GITHUB_OUTPUT"
echo "harmonics=$harmonics" >> "$GITHUB_OUTPUT"
- uses: docker/login-action@v3
if: github.event_name == 'push'
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- uses: docker/login-action@v3
if: github.event_name == 'push'
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- id: meta
if: github.event_name == 'push'
uses: docker/metadata-action@v5
with:
images: |
docker.io/openwatersio/xtide
ghcr.io/${{ github.repository }}
tags: |
type=raw,value=latest
type=raw,value=${{ steps.versions.outputs.xtide }}
type=raw,value=${{ steps.versions.outputs.xtide }}-h${{ steps.versions.outputs.harmonics }}
- uses: docker/build-push-action@v6
if: github.event_name == 'push'
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max