Skip to content

Update publish_dev.yml #20

Update publish_dev.yml

Update publish_dev.yml #20

Workflow file for this run

name: Publish dev
on:
push:
branches:
- dev
jobs:
publish_image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Login to Github Packages
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build image and push to GitHub Container Registry
uses: docker/build-push-action@v3
with:
# relative path to the place where source code with Dockerfile is located
context: .
push: true
tags: ghcr.io/allenneuraldynamics/aind-qc-portal:dev
update_ecs_service :
runs-on: ubuntu-latest
needs: publish_image
permissions:
id-token: write
contents: read
env:
AWS_IAM_ROLE: ${{ secrets.AWS_IAM_ROLE_DEV }}
AWS_REGION : ${{ vars.AWS_REGION }}
AWS_ECS_CLUSTER : ${{ vars.AWS_ECS_CLUSTER_DEV }}
AWS_ECS_SERVICE : ${{ vars.AWS_ECS_SERVICE_DEV }}
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Configure aws credentials
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: ${{ env.AWS_IAM_ROLE }}
role-session-name: github-ecs-update-service
aws-region: ${{ env.AWS_REGION }}
- name: Update ECS service
run: |
python -m pip install awscli
aws ecs update-service --cluster $AWS_ECS_CLUSTER --service $AWS_ECS_SERVICE --force-new-deployment