Skip to content

github action to publish images to ghcr #13

github action to publish images to ghcr

github action to publish images to ghcr #13

Workflow file for this run

name: Docker Image CI
on:
push:
branches: [ "master" ]
jobs:
build:
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- name: Set image postfix
run: echo "DOCKER_IMAGE_POSTFIX=$(date +%Y-%m-%d_%s)" >> "$GITHUB_ENV"
- name: Checkout the repo
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: https://ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push server image
uses: docker/build-push-action@v6
with:
context: "{{defaultContext}}:src"
file: PodLoad.Server/Dockerfile
push: true
tags: ghcr.io/rumkit/pod-load-simulator-server:${{ env.DOCKER_IMAGE_POSTFIX }}
- name: Build and push client image
uses: docker/build-push-action@v6
with:
context: "{{defaultContext}}:src"
file: PodLoad.Client/Dockerfile
push: true
tags: ghcr.io/rumkit/pod-load-simulator-client:${{ env.DOCKER_IMAGE_POSTFIX }}