Skip to content

Commit

Permalink
Merge pull request #4 from lukso-network/feat/docker-ci
Browse files Browse the repository at this point in the history
feat: Dockerize
  • Loading branch information
Wolmin authored Sep 24, 2024
2 parents 1ffd842 + fc4f940 commit 88ed081
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/publish-tag.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Publish Docker tag images

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

env:
DOCKER_REGISTRY: europe-docker.pkg.dev
DOCKER_IMAGE_NAME: lks-lz-artifacts/docker-clientdiversity/frontend

jobs:
build-docker:
permissions:
contents: "read"
id-token: "write"
runs-on: ubuntu-latest
steps:
- name: Checkout ${{ inputs.sha }}
uses: actions/checkout@v2

- name: Setup buildx
uses: docker/setup-buildx-action@v2

- name: Authenticate to Google Cloud
id: gcpauth
uses: google-github-actions/auth@v1
with:
create_credentials_file: "true"
workload_identity_provider: "projects/311968610280/locations/global/workloadIdentityPools/github/providers/github"
service_account: "[email protected]"

- name: login
run: |-
gcloud auth login --brief --cred-file="${{ steps.gcpauth.outputs.credentials_file_path }}"
gcloud auth configure-docker ${{ env.DOCKER_REGISTRY }}
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
context: .
file: ./Dockerfile
push: true
build-args: |
GIT_TAG=${{ github.ref_name }}
tags: |
${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }}:${{ github.ref_name }}
${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }}:latest
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM ruby:3.3-alpine3.20

WORKDIR /app

ENV BUNDLE_PATH=/app/vendor/bundle
ENV BUNDLER_VERSION='2.5.14'

COPY . /app

RUN apk update && \
apk upgrade && \
apk add --no-cache jq build-base curl bash && \
gem install bundler -v $BUNDLER_VERSION

RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
truncate -s 0 /var/log/*log

RUN bundle config set --local path 'vendor/bundle'
RUN bundle install

EXPOSE 4000

ENTRYPOINT ["bundle"]
CMD ["exec", "jekyll", "serve"]

0 comments on commit 88ed081

Please sign in to comment.