Skip to content

go.mod: update to 1.24.12 (#148) #22

go.mod: update to 1.24.12 (#148)

go.mod: update to 1.24.12 (#148) #22

Workflow file for this run

name: Publish Containers
permissions:
contents: read
packages: write
on:
push:
tags:
- "*"
# Allows manual triggering of the workflow
workflow_dispatch:
inputs:
tag:
description: "Tag release (e.g. v1.2.3)"
required: true
push:
description: "Push to registry"
required: false
type: boolean
default: false
# allow for testing of PR updating this file
pull_request:
paths:
- ".github/workflows/containers.yaml"
jobs:
build-and-maybe-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # 4.3.0
with:
fetch-depth: 0
ref: ${{ github.event.inputs.tag || github.ref }}
- name: Log in to GitHub Container Registry
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # 3.5.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Determine docker image tags
id: image_tags
env:
TAG: ${{ github.event.inputs.tag }}
REF: ${{ github.ref }}
run: |
# For PRs to this file tag the container "pull_request_test"
if [ "${{ github.event_name }}" = "pull_request" ]; then
echo "tags=ghcr.io/tailscale/tsidp:pull_request_test" >> $GITHUB_OUTPUT
exit 0
fi
# For tag push: use the tag name and also push "latest"
if [ "${{ github.event_name }}" = "push" ]; then
TAG="${REF#refs/tags/}"
echo "tags=ghcr.io/tailscale/tsidp:${TAG},ghcr.io/tailscale/tsidp:latest" >> $GITHUB_OUTPUT
exit 0
fi
# For workflow_dispatch: use the provided tag
echo "tags=ghcr.io/tailscale/tsidp:${TAG}" >> $GITHUB_OUTPUT
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # 3.11.1
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
# only push on tags or manually triggered with inputs.push set
push: ${{ github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.push) }}
tags: ${{ steps.image_tags.outputs.tags }}
platforms: linux/amd64,linux/arm64