diff --git a/.github/workflows/continuous-delivery.yml b/.github/workflows/continuous-delivery.yml new file mode 100644 index 00000000..20405081 --- /dev/null +++ b/.github/workflows/continuous-delivery.yml @@ -0,0 +1,47 @@ +name: Credo-Controller + +on: + push: + tags: + - 'v*' + +env: + REGISTRY: ghcr.io + SERVICE: credo-controller + +jobs: + build-and-push: + name: Push Docker image to GitHub + runs-on: ubuntu-latest + + permissions: + contents: read + packages: write + attestations: write + id-token: write + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Extract Git Tag + id: get_tag + run: echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and Push Docker Image ${{ env.SERVICE }} + uses: docker/build-push-action@v6 + with: + context: . + file: Dockerfile + push: true + tags: | + ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.SERVICE }}:${{ env.TAG }} + ${{ env.REGISTRY }}/${{ github.repository_owner }}/${{ env.SERVICE }}:latest + \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 210d04ee..c8175271 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,48 +1,3 @@ -# FROM ubuntu:20.04 - -# ENV DEBIAN_FRONTEND noninteractive - -# RUN apt-get update -y && apt-get install -y \ -# software-properties-common \ -# apt-transport-https \ -# curl \ -# # Only needed to build indy-sdk -# build-essential - -# RUN curl -fsSL https://deb.nodesource.com/setup_18.x | bash - - -# # yarn -# RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \ -# echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list - -# # install depdencies -# RUN apt-get update -y && apt-get install -y --allow-unauthenticated \ -# nodejs - -# # install depdencies -# RUN apt-get update -y && apt-get install -y --allow-unauthenticated \ -# nodejs - -# # Install yarn seperately due to `no-install-recommends` to skip nodejs install -# RUN apt-get install -y --no-install-recommends yarn - -# RUN yarn global add patch-package -# # AFJ specifc setup -# WORKDIR /www - -# COPY bin ./bin -# COPY package.json ./package.json -# COPY patches ./patches - -# RUN yarn install --production - -# COPY build ./build -# # COPY libindy_vdr.so /usr/lib/ -# # COPY libindy_vdr.so /usr/local/lib/ - -# ENTRYPOINT [ "./bin/afj-rest.js", "start" ] - - # Stage 1: Builder stage FROM node:18.19.0 AS builder @@ -76,4 +31,4 @@ COPY --from=builder /app/node_modules ./node_modules COPY --from=builder /app/patches ./patches # Set entry point -ENTRYPOINT ["node", "./bin/afj-rest.js", "start"] \ No newline at end of file +ENTRYPOINT ["node", "./bin/afj-rest.js", "start"]