Skip to content

feat(atproto): simplify AT Protocol badges and add pds.ls links (#374) #639

feat(atproto): simplify AT Protocol badges and add pds.ls links (#374)

feat(atproto): simplify AT Protocol badges and add pds.ls links (#374) #639

Workflow file for this run

name: Deploy Platform to Dev (GitOps)
on:
push:
branches: [main]
pull_request:
types: [opened, synchronize, reopened]
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 24
cache: 'npm'
- name: Install Dependencies
run: npm ci
- name: Run Linter
run: npm run lint
# Uncomment when unit tests are ready
# - name: Run unit tests
# run: npm run test:unit:ci
build-and-deploy:
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
outputs:
image_tag: ${{ steps.set-outputs.outputs.image_tag }}
steps:
- name: Checkout Platform repository
uses: actions/checkout@v4
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ vars.AWS_REGION || 'us-east-1' }}
- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v2
with:
mask-password: true
- name: Set image tag
id: set-outputs
run: |
echo "IMAGE_TAG=${{ github.sha }}" >> $GITHUB_ENV
echo "image_tag=${{ github.sha }}" >> $GITHUB_OUTPUT
- name: Build, tag, and push image to Amazon ECR
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: openmeet-ecr/openmeet-platform
GIT_REVISION: ${{ github.sha }}
GIT_BRANCH: ${{ github.ref_name }}
run: |
echo "Building image with tag: $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG"
APP_VERSION=$(node -p "require('./package.json').version")
docker buildx build --load \
--build-arg APP_VERSION="${APP_VERSION}" \
--build-arg COMMIT_SHA="${GITHUB_SHA}" \
-t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
# Tag as latest for main branch
docker tag $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG $ECR_REGISTRY/$ECR_REPOSITORY:latest
docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest
gitops-update:
needs: [build-and-deploy]
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: ./.github/workflows/update-image-gitops.yml
with:
service_name: platform
image_tag: ${{ needs.build-and-deploy.outputs.image_tag }}
environment: dev
ecr_registry: 433321780850.dkr.ecr.us-east-1.amazonaws.com
ecr_repository: openmeet-ecr/openmeet-platform
commit_message: "GitOps: Update Platform to ${{ needs.build-and-deploy.outputs.image_tag }} from main branch"
secrets:
GH_PAT: ${{ secrets.GH_PAT_INFRASTRUCTURE }}