diff --git a/.github/workflows/publish_dev.yml b/.github/workflows/publish_dev.yml new file mode 100644 index 0000000..680db10 --- /dev/null +++ b/.github/workflows/publish_dev.yml @@ -0,0 +1,28 @@ +name: Publish dev +on: + push: + branches: + - dev + - ci-11-deploy-aws + +jobs: + publish_ghcr: + 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 \ No newline at end of file diff --git a/.github/workflows/tag_and_publish.yml b/.github/workflows/tag_and_publish_main.yml similarity index 82% rename from .github/workflows/tag_and_publish.yml rename to .github/workflows/tag_and_publish_main.yml index 6418422..664efb2 100644 --- a/.github/workflows/tag_and_publish.yml +++ b/.github/workflows/tag_and_publish_main.yml @@ -1,4 +1,4 @@ -name: Tag and publish +name: Tag and publish main on: push: branches: @@ -66,7 +66,7 @@ jobs: uses: AllenNeuralDynamics/aind-github-actions/.github/workflows/tag.yml@main secrets: SERVICE_TOKEN: ${{ secrets.SERVICE_TOKEN }} - publish: + publish_pypi: needs: tag if: false runs-on: ubuntu-latest @@ -87,3 +87,23 @@ jobs: uses: pypa/gh-action-pypi-publish@release/v1 with: password: ${{ secrets.AIND_PYPI_TOKEN }} + publish_ghcr: + 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:latest diff --git a/README.md b/README.md index e6e32e8..e6b88ae 100644 --- a/README.md +++ b/README.md @@ -30,4 +30,8 @@ There is a `Dockerfile` which includes the entrypoint to launch the app. docker build -t aind-qc-portal . docker run -e ALLOW_WEBSOCKET_ORIGIN=localhost:8000 -p 8000:8000 aind-qc-portal ``` -2. Navigate to 'localhost:8000` to view the app. \ No newline at end of file +2. Navigate to 'localhost:8000` to view the app. + +### AWS +1. On pushes to the `dev` or `main` branch, a GitHub Action will run to publish a Docker image to `ghcr.io/allenneuraldynamics/aind-qc-portal:dev` or `ghcr.io/allenneuraldynamics/aind-qc-portal:latest`. +2. The image can be used by a ECS Service in AWS to run a task container. Application Load Balancer can be used to serve the container from ECS. Please note that the task must be configured with the correct env variables (e.g. `API_GATEWAY_HOST`, `ALLOW_WEBSOCKET_ORIGIN`). \ No newline at end of file