# Full project: https://gitlab.com/pages/plain-html
pages:
  stage: deploy
  script:
    - cp -r client public
  artifacts:
    paths:
      - public
  rules:
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH

container:
  stage: build
  image: git.fossgalaxy.com:8042/gamedev/containers/fedora:35-podman
  before_script:
    - podman version
    - buildah version
    - export STORAGE_DRIVER=vfs
    - echo "$CI_REGISTRY_PASSWORD" | buildah login -u "$CI_REGISTRY_USER" --password-stdin $CI_REGISTRY
  script:
    - cd server/
    - buildah bud -t ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHA} .
    - buildah push ${CI_REGISTRY_IMAGE}:${CI_COMMIT_SHA} ${CI_REGISTRY_IMAGE}:${CI_COMMIT_REF_NAME}
  after_script:
    - podman logout "${CI_REGISTRY}"
  rules:
    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH