Skip to content

Merge pull request #59 from TheWorldAvatar/dependabot-updates #19

Merge pull request #59 from TheWorldAvatar/dependabot-updates

Merge pull request #59 from TheWorldAvatar/dependabot-updates #19

Workflow file for this run

name: Docker Image CI
on:
push:
branches: main
paths:
- code/**
workflow_dispatch:
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set version variables from file
id: read-version
run: |
VERSION=$(cat VERSION)
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "MAJOR=$(echo $VERSION | cut -d. -f1)" >> $GITHUB_ENV
echo "MINOR=$(echo $VERSION | cut -d. -f1).$(echo $VERSION | cut -d. -f2)" >> $GITHUB_ENV
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build docker image and push to ghcr
uses: docker/build-push-action@v6
with:
push: true
tags: |
ghcr.io/theworldavatar/viz:latest
ghcr.io/theworldavatar/viz:${{ env.VERSION }}
ghcr.io/theworldavatar/viz:${{ env.MAJOR }}
ghcr.io/theworldavatar/viz:${{ env.MINOR }}