Files
spacedrive/.github/workflows/server.yml
Vítor Vasconcellos c1e98dcb0d Update github actions due to nodejs 16 deprecation (#2107)
* Update github actions due to nodejs 16 deprecation
 - Replace archived actions-rs/clippy-check with maintained fork actions-rs-plus/clippy-check
 - Replace redhat-actions/push-to-registry with updated fork Eusebiotrigo/push-to-registry
 - Point redhat-actions/buildah-build and softprops/action-gh-release to current master to fix nodejs deprecation

* Build the correct ios core rust arch for CI runs

* Build ios app for the same arch as the host in Mobile CI

* Some changes to try and make cache-factory faster and avoid failing so much

* Add trigger to run cache-factory on pull requests when there are changes to itself

* Attempt to fix sed usage on macOS

* Don't treat warning as errors

* Fix windows

* Fix windows 2

* Use target ad cache key for rust to differentiate between macOS x86_64 and arm64

* Use faster/better linkers to compile for macOS, Linux and Windows

* Fix missing shell in action

* Fix typo

* Fix missing shell in action 2

* Fix mold download
 - Replace bsdtar with plain tar

* Fix permission denied when extracting mold

* Remove zld

* Don't restore cache for rustfmt
 - Remove target symlink to C:/ in an attempt to speed-up windows CI

* Fix typo

* Restore target symlink on windows
 - Removing it didn't make CI faster

* Run Mobile on macos-14
2024-02-21 09:27:40 +00:00

81 lines
2.6 KiB
YAML

name: Server release
on:
release:
types: [published]
workflow_dispatch:
jobs:
build-server:
name: Build a docker image for spacedrive server
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Maximize build space
if: ${{ runner.os == 'Linux' }}
uses: easimon/maximize-build-space@master
with:
remove-codeql: 'true'
remove-dotnet: 'true'
remove-haskell: 'true'
remove-android: 'true'
overprovision-lvm: 'true'
remove-docker-images: 'true'
- name: Checkout repository
uses: actions/checkout@v4
- name: Update buildah
shell: bash
run: |
wget -O- 'https://github.com/HeavenVolkoff/buildah-static/releases/latest/download/buildah-amd64.tar.gz' \
| sudo tar -xzf- -C /usr/local/bin
- name: Determine image name & tag
id: image_info
shell: bash
run: |
if [ "$GITHUB_EVENT_NAME" == "release" ]; then
IMAGE_TAG="${GITHUB_REF##*/}"
else
IMAGE_TAG="$(git rev-parse --short "$GITHUB_SHA")"
fi
IMAGE_TAG="${IMAGE_TAG,,}"
IMAGE_NAME="${GITHUB_REPOSITORY,,}/server"
echo "Building ${IMAGE_NAME}:${IMAGE_TAG}"
echo "tag=${IMAGE_TAG}" >> "$GITHUB_OUTPUT"
echo "name=${IMAGE_NAME}" >> "$GITHUB_OUTPUT"
echo "repo=${GITHUB_REPOSITORY}" >> "$GITHUB_OUTPUT"
echo "repo_ref=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> "$GITHUB_OUTPUT"
- name: Build image
id: build-image
# TODO: Change to stable version when available
uses: redhat-actions/buildah-build@c79846f
with:
tags: ${{ steps.image_info.outputs.tag }} ${{ github.event_name == 'release' && 'latest' || 'staging' }}
archs: amd64
image: ${{ steps.image_info.outputs.name }}
layers: 'false'
context: ./apps/server/docker
build-args: |
REPO=${{ steps.image_info.outputs.repo }}
REPO_REF=${{ steps.image_info.outputs.repo_ref }}
containerfiles: |
./apps/server/docker/Dockerfile
- name: Push image to ghcr.io
# TODO: Restore redhat-actions/push-to-registry after PR is merged:
# https://github.com/redhat-actions/push-to-registry/pull/93
uses: Eusebiotrigo/push-to-registry@5acfa47
with:
tags: ${{ steps.build-image.outputs.tags }}
image: ${{ steps.build-image.outputs.image }}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}