Skip to content

Deploy

Deploy #18

Workflow file for this run

name: Deploy
on:
workflow_dispatch:
inputs:
image_version:
description: 'The version of the Docker image'
required: true
env:
DOCKER_REGISTRY: ghcr.io
REPOSITORY_OWNER: tibiastalker
IMAGE_NAME: tibia-stalker-api
IMAGE_VERSION: ${{ github.event.inputs.image_version }}
jobs:
build-and-push-docker-image:
runs-on: ubuntu-20.04
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Login to GitHub Packages
uses: docker/login-action@v2
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Docker image
run: docker build -t ${{ env.DOCKER_REGISTRY }}/${{ env.REPOSITORY_OWNER }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_VERSION }} .
- name: Push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ env.DOCKER_REGISTRY }}/${{ env.REPOSITORY_OWNER }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_VERSION }}