~.gitfoss.ci
.sh
Shell
(text/x-sh)
stages:
  - name: build
    image: alpine:3.18
    workdir: ./.workdir/:/home/node/
    env:
      FOO: "$HOME"
    shell: sh
    steps:
      - name: build:gitfoss:web
        commands:
          - git clone https://gitfoss.dev/ethicdevs/gitfoss.git || true
          - cd gitfoss/
          - git fetch
          - git checkout master
          - yarn
          - yarn build
        cached:
          - /home/node/build/gitfoss/dist/
          - /home/node/build/gitfoss/public/
          - /home/node/build/gitfoss/.gitstamp
      - name: build:gitfoss:web:docker
        env:
          IMAGE: "gitfoss_web:$(git rev-parse --short HEAD)"
          HOST: "0.0.0.0"
          PORT: 3000
        commands:
          - git clone https://gitfoss.dev/ethicdevs/gitfoss.git || true
          - cd gitfoss/
          - git fetch
          - git checkout master
          - docker build --build-arg HOST=${HOST} --build-arg PORT=${PORT} -f Dockerfile -t ${IMAGE} .
          - docker save -o ./${IMAGE}.tar docker.io/library/${IMAGE}
        cached:
          - /home/node/build/gitfoss/${IMAGE}.tar
      - name: build:gitfoss_ci
        commands:
          - git clone https://gitfoss.dev/ethicdevs/gitfoss.git || true
          - cd gitfoss/
          - git fetch
          - git checkout master
          - cd ./packages/gitfoss-ci/
          - shards install
          - shards build
        cached:
          - /home/node/build/gitfoss/packages/gitfoss-ci/bin/gitfoss-ci
      - name: build:gitfoss_ci:runner
        commands:
          - git clone https://gitfoss.dev/ethicdevs/gitfoss.git || true
          - cd gitfoss/
          - git fetch
          - git checkout master
          - cd ./packages/gitfoss-ci-runner/
          - shards install
          - shards build
        cached:
          - /home/node/build/gitfoss/packages/gitfoss-ci-runner/bin/gitfoss-ci-runner