forked from etheralpha/clientdiversity-org
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from lukso-network/feat/docker-ci
feat: Dockerize
- Loading branch information
Showing
2 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] | ||
|