name: Deploy
run-name: ${{ gitea.actor }} build image and push to container registry

on:
  registry_package:
    types: [published]

jobs:
  # CreateImage:
  #   runs-on: [skeris]
  #   uses: http://gitea.pena/PenaDevops/actions.git/.gitea/workflows/build-image.yml@v1.1.6-p
  #   with:
  #     runner: skeris
  #   secrets:
  #     REGISTRY_USER: ${{ secrets.REGISTRY_USER }}
  #     REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
  DeployService:
    if: contains(github.event.package.name, 'staging')
    runs-on: [frontstaging]
    container:
      image: gitea.pena:3000/penadevops/container-images/node-compose:main
      env:
        GITHUB_RUN_NUMBER: "${{ inputs.actionid }}"
      volumes:
        - /run/user/1000/docker/docker.sock:/run/user/1000/docker/docker.sock
    steps:
      - name: Check out repository code
        uses: http://gitea.pena:3000/PenaDevops/actions.git/checkout@v1
      - run: compose -f deployments/staging/docker-compose.yaml up -d
    

