-
Notifications
You must be signed in to change notification settings - Fork 241
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: CLDSRV-278 add github action to release image for fed
- Loading branch information
1 parent
2a935b3
commit d4683c1
Showing
2 changed files
with
99 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,50 @@ | ||
--- | ||
name: release-federation | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: 'Tag to be released' | ||
required: true | ||
|
||
env: | ||
REGISTRY_NAME: registry.scality.com | ||
PROJECT_NAME: ${{ github.event.repository.name }} | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Login to Registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ${{ env.REGISTRY_NAME }} | ||
username: ${{ secrets.REGISTRY_LOGIN }} | ||
password: ${{ secrets.REGISTRY_PASSWORD }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
file: images/svc-base/Dockerfile | ||
push: true | ||
tags: "${{ env.REGISTRY_NAME }}/${{env.PROJECT_NAME }}/${{ env.PROJECT_NAME }}:${{ github.event.inputs.tag }}-svc-base" | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
|
||
- name: Create Release | ||
uses: softprops/action-gh-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
name: Release ${{ github.event.inputs.tag }} | ||
tag_name: ${{ github.event.inputs.tag }} | ||
generate_release_notes: true | ||
target_commitish: ${{ github.sha }} |
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,49 @@ | ||
FROM registry.scality.com/federation/nodesvc-base:7.10.6.0 | ||
|
||
WORKDIR /usr/src/app | ||
|
||
# Keep the .git directory in order to properly report version | ||
COPY ./package.json yarn.lock ./ | ||
|
||
ENV PYTHON=python3.9 | ||
ENV PY_VERSION=3.9.7 | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y --no-install-recommends \ | ||
jq \ | ||
python \ | ||
git \ | ||
build-essential \ | ||
ssh \ | ||
ca-certificates \ | ||
wget \ | ||
libffi-dev \ | ||
zlib1g-dev \ | ||
&& mkdir -p /root/ssh \ | ||
&& ssh-keyscan -H github.com > /root/ssh/known_hosts | ||
|
||
RUN cd /tmp \ | ||
&& wget https://www.python.org/ftp/python/$PY_VERSION/Python-$PY_VERSION.tgz \ | ||
&& tar -C /usr/local/bin -xzvf Python-$PY_VERSION.tgz \ | ||
&& cd /usr/local/bin/Python-$PY_VERSION \ | ||
&& ./configure --enable-optimizations \ | ||
&& make \ | ||
&& make altinstall \ | ||
&& rm -rf /tmp/Python-$PY_VERSION.tgz | ||
|
||
RUN yarn cache clean \ | ||
&& yarn install --production --ignore-optional --ignore-engines --network-concurrency 1 \ | ||
&& apt-get autoremove --purge -y python git build-essential \ | ||
&& rm -rf /var/lib/apt/lists/* \ | ||
&& yarn cache clean \ | ||
&& rm -rf ~/.node-gyp \ | ||
&& rm -rf /tmp/yarn-* | ||
|
||
COPY ./ ./ | ||
|
||
VOLUME ["/usr/src/app/localData","/usr/src/app/localMetadata"] | ||
|
||
ENTRYPOINT ["/usr/src/app/docker-entrypoint.sh"] | ||
CMD [ "yarn", "start" ] | ||
|
||
EXPOSE 8000 |