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

wip: feat: create ARM containers too #430

Closed
wants to merge 6 commits into from
Closed
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
63 changes: 63 additions & 0 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Containers

on: [push]

jobs:
build-containers:
runs-on: ubuntu-latest
steps:
- uses: linz/action-typescript@v2
with:
package-manager: npm

- name: Get GIT Version infromation
id: version
run: |
GIT_HASH=$(git rev-parse HEAD)
GIT_VERSION=$(git describe --tags --always --match 'v*')
GIT_VERSION_MAJOR=$(echo $GIT_VERSION | cut -d. -f1)
GIT_VERSION_MAJOR_MINOR=$(echo $GIT_VERSION | cut -d. -f1,2)

echo "hash=${GIT_HASH}" >> $GITHUB_OUTPUT
echo "version=${GIT_VERSION}" >> $GITHUB_OUTPUT
echo "version_major=${GIT_VERSION_MAJOR}" >> $GITHUB_OUTPUT
echo "version_major_minor=${GIT_VERSION_MAJOR_MINOR}" >> $GITHUB_OUTPUT

- name: Setup docker tags
id: tags
uses: actions/github-script@v6
with:
result-encoding: string
script:
const tags = [];
tags.push('ghcr.io/${{ github.repository }}:latest');
tags.push('ghcr.io/${{ github.repository }}:${{ steps.version.outputs.version }}');
return tags.join(', ')

- name: Set up Docker Qemu
id: qemu
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2

- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Docker build and push - Build and push
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile
platforms: linux/amd64
tags: ${{ steps.tags.outputs.result }}
args:
GIT_VERSION=${{ steps.version.outputs.version }}
GIT_HASH=${{ steps.version.outputs.hash }}
push: false

59 changes: 0 additions & 59 deletions .github/workflows/push.yml

This file was deleted.

76 changes: 0 additions & 76 deletions .github/workflows/release-please.yml

This file was deleted.

12 changes: 10 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,16 @@ WORKDIR /app

ENV NODE_ENV production

ADD package.json yarn.lock /app/
RUN yarn install --production
ADD package.json package-lock.json /app/
RUN npm install --omit=dev

# Git Hash/Version have no impact on Yarn install
ARG GIT_VERSION
ARG GIT_HASH

ENV GIT_VERSION ${GIT_VERSION}
ENV GIT_HASH ${GIT_HASH}

ADD build/src /app/

ENTRYPOINT ["node", "/app/index.js"]
Loading