summaryrefslogtreecommitdiff
path: root/vere/.github/workflows/docker-shared.yml
blob: a2a0eb7caeafa5bbe719ebdb8ab639b8cba7cb40 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
name: docker

on:
  workflow_call:
    inputs:
      pace:
        description: 'Release pace'
        type: string
        default: 'edge'
        required: false

jobs:
  urbit:
    runs-on: ubuntu-22.04

    steps:
      - uses: actions/checkout@v3

      - uses: mlugg/setup-zig@v1
        with:
          version: 0.14.0

      #
      # BUILD
      #

      - name: Build binary
        id: build
        run: |
          zig build                    \
            -Dtarget=x86_64-linux-musl \
            -Doptimize=ReleaseFast     \
            -Dpace=${{inputs.pace}}    \
            --summary all

          cp zig-out/x86_64-linux-musl/urbit docker/.

          echo version=v$(sed -nr 's/#define URBIT_VERSION "(.*)"/\1/p' zig-out/include/version.h) >> $GITHUB_OUTPUT

      #
      # UPLOAD TO DOCKER
      #

      - uses: docker/docker-login-action@v1.8.0
        with:
          username: ${{ secrets.DOCKERHUB_USERNAME }}
          password: ${{ secrets.DOCKERHUB_TOKEN }}

      - uses: christian-korneck/update-container-description-action@v1
        env:
          DOCKER_USER: ${{ secrets.DOCKERHUB_USERNAME }}
          DOCKER_PASS: ${{ secrets.DOCKERHUB_TOKEN }}
        with:
          destination_container_repo: ${{ secrets.DOCKERHUB_USERNAME }}/vere
          provider: dockerhub
          short_description: 'Urbit: a clean-slate OS and network for the 21st century'
          readme_file: 'docker/README.md'

      - name: Build and push
        if: ${{ inputs.pace != 'live' }}
        uses: docker/build-push-action@v6
        with:
          push: true
          context: docker
          tags: tloncorp/vere:${{ steps.build.outputs.version }},tloncorp/vere:${{ inputs.pace }}

      - name: Build and push live
        if: ${{ inputs.pace == 'live' }}
        uses: docker/build-push-action@v6
        with:
          push: true
          context: docker
          tags: tloncorp/vere:latest