Skip to content

Github actions should be better #3

Github actions should be better

Github actions should be better #3

Workflow file for this run

name: Build and Push Docker Image
on:
push:
tags:
- "v*"
jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Extract version from tag
id: version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
ghcr.io/proofrock/tsk:${{ steps.version.outputs.VERSION }}
ghcr.io/proofrock/tsk:latest
build-args: |
VERSION=${{ steps.version.outputs.VERSION }}
platforms: linux/amd64