Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PR publishing #1068

Merged
merged 3 commits into from
Aug 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 24 additions & 9 deletions .github/workflows/pr-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ jobs:
include:
- runner-platform: ubuntu-latest
build-arch: linux/amd64
tagged-platform: amd64
- runner-platform: namespace-profile-default-arm64
build-arch: linux/arm64
tagged-platform: arm64
runs-on: ${{ matrix.runner-platform }}
steps:
- name: Prepare
Expand Down Expand Up @@ -52,24 +50,41 @@ jobs:
id: build
uses: docker/build-push-action@v6
with:
outputs: type=docker,dest=/tmp/image.tar
tags: ${{ steps.meta.outputs.tags }}
outputs: type=docker,dest=/tmp/image-${{ env.PLATFORM_PAIR }}.tar
platforms: ${{ matrix.build-arch }}
tags: |
${{ env.REGISTRY_IMAGE }}:${{ github.sha }}-${{ env.PLATFORM_PAIR }}
build-args: |
COMMIT_HASH=${{ github.sha }}
BUILD_DATE=${{ steps.current-time.outputs.time }}

- name: Export digest
- name: Export Docker meta output
shell: bash
run: echo $DOCKER_METADATA_OUTPUT_JSON > /tmp/metadata.json

- name: Upload metadata
uses: actions/upload-artifact@v4
with:
name: metadata
path: /tmp/metadata.json
overwrite: true

- name: Export SHA
run: |
mkdir -p /tmp/digests
digest="${{ steps.build.outputs.digest }}"
touch "/tmp/digests/${digest#sha256:}"
echo "${{ github.sha }}" > /tmp/sha.txt

- name: Upload SHA
uses: actions/upload-artifact@v4
with:
name: sha
path: /tmp/sha.txt
overwrite: true

- name: Upload image
uses: actions/upload-artifact@v4
with:
name: image-${{ env.PLATFORM_PAIR }}
path: /tmp/image.tar
path: /tmp/image-${{ env.PLATFORM_PAIR }}.tar
if-no-files-found: error
retention-days: 1

Expand Down
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ COPY . .
ARG COMMIT_HASH=unknown
ARG BUILD_DATE=unknown

ENV DATA_DIR /data
ENV NODE_ENV production
ENV COMMIT_HASH $COMMIT_HASH
ENV BUILD_DATE $BUILD_DATE
ENV DATA_DIR=/data
ENV NODE_ENV=production
ENV COMMIT_HASH=$COMMIT_HASH
ENV BUILD_DATE=$BUILD_DATE

CMD ["tini", "--", "node", "--enable-source-maps", "dist/scripts/migrate-and-start.js"]
Loading