Skip to content

Bump the github-workflows group with 5 updates #22

Bump the github-workflows group with 5 updates

Bump the github-workflows group with 5 updates #22

Workflow file for this run

name: Build & Publish Parsec Server Docker Image
# cspell:words buildx
on:
workflow_dispatch:
pull_request:
paths:
- server/packaging/server/**
- .github/workflows/docker-server.yml
# Only run on pushed tag because we don't want this workflow to run everytime we push something to the main branch.
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+*
permissions:
contents: write
packages: write
# We set `concurrency` to prevent having this workflow being run on code that is not up-to-date on a PR (a user make multiple push in a quick manner).
# But outside of a PR, we want to have only 1 workflow to be run at the same time on a given git ref
concurrency:
group: docker-server-${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
docker-server:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # pin v4.1.1
timeout-minutes: 3
# Set up BuildKit Docker container builder to be able to build
# multi-platform images and export cache
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
- name: Log in to the Github Container registry
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get current version
id: version
run: |
sed -n 's/^.*Tool.Parsec: "\(.*\)",$/current=\1/p' misc/version_updater.py | tee $GITHUB_OUTPUT
- name: Generate build metadata
uses: docker/metadata-action@e6428a5c4e294a61438ed7f43155db912025b6b3 # v5.2.0
id: metadata
with:
images:
ghcr.io/scille/parsec-cloud/parsec-server
tags: |
type=semver,pattern={{ version }}
type=semver,pattern={{ major }}.{{ minor }}
type=raw,value=${{ steps.version.outputs.current }}+{{ date 'YYYYMMDD' }}.sha.{{ sha }}
flavor: |
latest=${{ github.event_name == 'push' && github.ref_type == 'tag' }}
- name: Image to be published
run: echo ${{ steps.metadata.outputs.tags }}
- name: Build and publish
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0
id: build
with:
context: .
file: server/packaging/server/server.dockerfile
tags: ${{ steps.metadata.outputs.tags }}
labels: ${{ steps.metadata.outputs.labels }}
push: ${{ (github.event_name == 'push' && github.ref_type == 'tag') || github.event_name == 'workflow_dispatch' }}