remove all stages except deploy in gha

This commit is contained in:
Maidul Islam
2024-03-22 14:12:06 -04:00
parent 7766a7f4dd
commit 44ca8c315e

View File

@ -6,87 +6,87 @@ permissions:
contents: read
jobs:
infisical-image:
name: Build backend image
runs-on: ubuntu-latest
steps:
- name: ☁️ Checkout source
uses: actions/checkout@v3
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_FOR_ECR }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_FOR_ECR }}
aws-region: us-east-1
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1
- name: 📦 Install dependencies to test all dependencies
run: npm ci --only-production
working-directory: backend
# - name: 🧪 Run tests
# run: npm run test:ci
# working-directory: backend
- name: Save commit hashes for tag
id: commit
uses: pr-mpt/actions-commit-hash@v2
- name: 🔧 Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: 🐋 Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Depot CLI
uses: depot/setup-action@v1
- name: 📦 Build backend and export to Docker
uses: depot/build-push-action@v1
with:
project: 64mmf0n610
token: ${{ secrets.DEPOT_PROJECT_TOKEN }}
load: true
context: .
file: Dockerfile.standalone-infisical
tags: infisical/infisical:test
- name: 🏗️ Build backend and push to docker hub
uses: depot/build-push-action@v1
with:
project: 64mmf0n610
token: ${{ secrets.DEPOT_PROJECT_TOKEN }}
push: true
context: .
file: Dockerfile.standalone-infisical
tags: |
infisical/staging_infisical:${{ steps.commit.outputs.short }}
infisical/staging_infisical:latest
platforms: linux/amd64,linux/arm64
build-args: |
POSTHOG_API_KEY=${{ secrets.PUBLIC_POSTHOG_API_KEY }}
INFISICAL_PLATFORM_VERSION=${{ steps.extract_version.outputs.version }}
# infisical-image:
# name: Build backend image
# runs-on: ubuntu-latest
# steps:
# - name: ☁️ Checkout source
# uses: actions/checkout@v3
# - name: Configure AWS credentials
# uses: aws-actions/configure-aws-credentials@v1
# with:
# aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID_FOR_ECR }}
# aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY_FOR_ECR }}
# aws-region: us-east-1
# - name: Login to Amazon ECR
# id: login-ecr
# uses: aws-actions/amazon-ecr-login@v1
# - name: 📦 Install dependencies to test all dependencies
# run: npm ci --only-production
# working-directory: backend
# # - name: 🧪 Run tests
# # run: npm run test:ci
# # working-directory: backend
# - name: Save commit hashes for tag
# id: commit
# uses: pr-mpt/actions-commit-hash@v2
# - name: 🔧 Set up Docker Buildx
# uses: docker/setup-buildx-action@v2
# - name: 🐋 Login to Docker Hub
# uses: docker/login-action@v2
# with:
# username: ${{ secrets.DOCKERHUB_USERNAME }}
# password: ${{ secrets.DOCKERHUB_TOKEN }}
# - name: Set up Depot CLI
# uses: depot/setup-action@v1
# - name: 📦 Build backend and export to Docker
# uses: depot/build-push-action@v1
# with:
# project: 64mmf0n610
# token: ${{ secrets.DEPOT_PROJECT_TOKEN }}
# load: true
# context: .
# file: Dockerfile.standalone-infisical
# tags: infisical/infisical:test
# - name: 🏗️ Build backend and push to docker hub
# uses: depot/build-push-action@v1
# with:
# project: 64mmf0n610
# token: ${{ secrets.DEPOT_PROJECT_TOKEN }}
# push: true
# context: .
# file: Dockerfile.standalone-infisical
# tags: |
# infisical/staging_infisical:${{ steps.commit.outputs.short }}
# infisical/staging_infisical:latest
# platforms: linux/amd64,linux/arm64
# build-args: |
# POSTHOG_API_KEY=${{ secrets.PUBLIC_POSTHOG_API_KEY }}
# INFISICAL_PLATFORM_VERSION=${{ steps.extract_version.outputs.version }}
postgres-migration:
name: Run latest migration files
runs-on: ubuntu-latest
needs: [infisical-image]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Node.js environment
uses: actions/setup-node@v2
with:
node-version: "20"
- name: Change directory to backend and install dependencies
env:
DB_CONNECTION_URI: ${{ secrets.AWS_DB_CONNECTION_URI }}
run: |
cd backend
npm install
npm run migration:latest
# postgres-migration:
# name: Run latest migration files
# runs-on: ubuntu-latest
# needs: [infisical-image]
# steps:
# - name: Checkout code
# uses: actions/checkout@v2
# - name: Setup Node.js environment
# uses: actions/setup-node@v2
# with:
# node-version: "20"
# - name: Change directory to backend and install dependencies
# env:
# DB_CONNECTION_URI: ${{ secrets.AWS_DB_CONNECTION_URI }}
# run: |
# cd backend
# npm install
# npm run migration:latest
gamma-deployment:
name: Deploy to gamma
runs-on: ubuntu-latest
needs: [postgres-migration]
# needs: [postgres-migration]
steps:
- name: ☁️ Checkout source
uses: actions/checkout@v3