Skip to content

Commit

Permalink
feat: add preview
Browse files Browse the repository at this point in the history
  • Loading branch information
RaoHai committed Apr 9, 2024
1 parent a0a2128 commit 59ed81c
Showing 1 changed file with 1 addition and 44 deletions.
45 changes: 1 addition & 44 deletions .github/workflows/aws-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,55 +38,12 @@ jobs:
id: login-ecr
uses: aws-actions/amazon-ecr-login@2fc7aceee09e9e4a7105c0d060c656fad0b4f63d # v1

- name: Login to GitHub Container Registry
uses: docker/login-action@465a07811f14bebb1938fbed4728c6a1ff8901fc # v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Login to Docker Hub
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3

- name: Create Docker Cacha Storage Backend
run: |
docker buildx create --use --driver=docker-container
- name: See the file in the runner
run: |
ls -la
- name: Build, tag, and push image to Amazon ECR
id: build-image
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
IMAGE_TAG: ${{ github.sha }}
with:
context: ./server/
file: ./server/Dockerfile.aws.lambda
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }}, ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max

deploy:
needs: build_and_push
runs-on: ubuntu-latest
environment: production
strategy:
fail-fast: false
matrix:
include:
- name: "xuexiao"
service: "xuexiao-preview"
task_definition: ".aws/task_definition_preview.json"
container: "xuexiao"
fail-fast: true

steps:
- name: Checkout
Expand Down

0 comments on commit 59ed81c

Please sign in to comment.