Skip to content

Update actions/checkout action to v4 #266

Update actions/checkout action to v4

Update actions/checkout action to v4 #266

Workflow file for this run

name: ci
on:
push:
branches:
- 'main'
tags:
- 'v*.*.*'
pull_request:
branches:
- 'main'
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get websockify version
run: |
VERSION=$( grep -oP "websockify==\K.*" requirements.txt )
echo "version=$VERSION" >> $GITHUB_OUTPUT
id: websockify_version
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
jwnmulder/websockify
ghcr.io/jwnmulder/websockify
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}},value=${{ steps.websockify_version.outputs.version }}
type=semver,pattern={{major}}.{{minor}},value=${{ steps.websockify_version.outputs.version }}
type=semver,pattern={{major}},value=${{ steps.websockify_version.outputs.version }},enable=${{ !startsWith(steps.websockify_version.outputs.version, '0.') }}
labels: |
org.opencontainers.image.source=https://github.com/novnc/websockify
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GHCR
if: github.event_name != 'pull_request'
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}