diff options
Diffstat (limited to 'vere/.github/workflows/docker-shared.yml')
-rw-r--r-- | vere/.github/workflows/docker-shared.yml | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/vere/.github/workflows/docker-shared.yml b/vere/.github/workflows/docker-shared.yml new file mode 100644 index 0000000..a2a0eb7 --- /dev/null +++ b/vere/.github/workflows/docker-shared.yml @@ -0,0 +1,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 |