Skip to content

Commit

Permalink
Remove certificate modification in Dockerfile, add new CI/CD for prod…
Browse files Browse the repository at this point in the history
…uction

This commit removes the certificate modification step in the Dockerfile and adds a new GitHub workflow for production CI/CD. The new workflow involves different steps for Docker meta creation, Google authentication, Docker registry login, and image build & push operations. This is primarily for enhancing automation and managing deployments better.
  • Loading branch information
CreatedByBdr committed Feb 7, 2024
1 parent 9fe0fc6 commit 8df24ed
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 5 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/cicd-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: gol2

on:
push:
tags:
- 'v*'
workflow_dispatch:

jobs:
Build:
runs-on: ubuntu-latest
outputs:
tag: ${{ steps.meta.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: europe-west9-docker.pkg.dev/gol2-development/gol2-indexer/dev
flavor: latest=false
tags: |
type=ref,event=tag
- uses: 'google-github-actions/auth@v2'
id: auth
with:
token_format: access_token
project_id: 'gol2-production'
credentials_json: '${{ secrets.GOOGLE_CREDENTIALS_PROD }}'

- name: Login to GAR
uses: docker/login-action@v3
with:
registry: europe-west9-docker.pkg.dev
username: oauth2accesstoken
password: ${{ steps.auth.outputs.access_token }}

- name: Build and push
uses: docker/build-push-action@v5
with:
file: Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
5 changes: 2 additions & 3 deletions .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- 'main'
- 'update-starknet'
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -45,6 +46,4 @@ jobs:
file: Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
secrets: |
"certificate=${{ secrets.CERTIFICATE }}"
labels: ${{ steps.meta.outputs.labels }}
2 changes: 0 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ FROM node:16.15.1

ADD indexer/ /app
WORKDIR /app
RUN --mount=type=secret,id=certificate \
cat /run/secrets/certificate >> /app/ca-certificate.crt

RUN yarn install && yarn build

Expand Down

0 comments on commit 8df24ed

Please sign in to comment.