pipeline:
  build:
    when:
      event:
      - tag
      - push
    image: node:16
    commands:
    - apt-get update && apt-get install -y zip
    - yarn install --frozen-lockfile
    - TARGET=distribution ./build.sh
    - zip mastofe.zip -r distribution

  release:
    image: akkoma/releaser
    when:
      event:
      - tag
      - push
    secrets:
    - SCW_ACCESS_KEY
    - SCW_SECRET_KEY
    - SCW_DEFAULT_ORGANIZATION_ID
    commands:
      - export SOURCE=mastofe.zip
      - export DEST=scaleway:akkoma-updates/frontend/$${CI_COMMIT_TAG:-"$CI_COMMIT_BRANCH"}/fedibird-fe.zip
      - /bin/sh /entrypoint.sh

