Skip to content

Commit

Permalink
Improve docker cache for cross #838
Browse files Browse the repository at this point in the history
  • Loading branch information
joepio committed Feb 15, 2024
1 parent e4cf2ff commit 8170e40
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ jobs:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Earthly build, test
run: earthly --org ontola --ci --sat henk -P +pipeline
- name: Convert newline-separated list to space-separated
id: format_tags
run: |
SPACE_SEPARATED_TAGS=$(echo "${{ steps.meta.outputs.tags }}" | tr '\n' ' ')
echo "steps.meta.output.tags=${{ steps.meta.outputs.tags }}"
echo "SPACE_SEPARATED_TAGS=$SPACE_SEPARATED_TAGS" >> $GITHUB_ENV
echo "Space-separated tags: "
# - name: Convert newline-separated list to space-separated
# id: format_tags
# run: |
# SPACE_SEPARATED_TAGS=$(echo "${{ steps.meta.outputs.tags }}" | tr '\n' ' ')
# echo "steps.meta.output.tags=${{ steps.meta.outputs.tags }}"
# echo "SPACE_SEPARATED_TAGS=$SPACE_SEPARATED_TAGS" >> $GITHUB_ENV
# echo "Space-separated tags: $SPACE_SEPARATED_TAGS"
- name: Earthly build and push docker
run: earthly --org ontola --ci --sat henk -P --push +docker-all --tags="$SPACE_SEPARATED_TAGS"
run: earthly --org ontola --ci --sat henk -P --push +docker-all --tags="${{ steps.meta.outputs.tags }}"
7 changes: 3 additions & 4 deletions Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,8 @@ cross-build:
FROM +source
ARG --required TARGET
DO rust+SET_CACHE_MOUNTS_ENV
RUN cross --version
WITH DOCKER
RUN --mount=$EARTHLY_RUST_CARGO_HOME_CACHE --mount=$EARTHLY_RUST_TARGET_CACHE cross build --target $TARGET --release
END
DO rust+CROSS --target ${TARGET}
# DO rust+COPY_OUTPUT --output="release/[^\./]+"
DO rust+COPY_OUTPUT --output=".*" # Copies all files to ./target
RUN ./target/$TARGET/release/atomic-server --version
SAVE ARTIFACT ./target/$TARGET/release/atomic-server AS LOCAL artifact/bin/atomic-server-$TARGET
Expand All @@ -89,6 +87,7 @@ docker-musl:
EXPOSE 80
VOLUME /atomic-storage
ENTRYPOINT ["/atomic-server-bin"]
RUN echo "Pushing tags: ${tags}"
SAVE IMAGE --push ${tags}

setup-playwright:
Expand Down

0 comments on commit 8170e40

Please sign in to comment.