diff --git a/.github/workflows/deploy-staging.yml b/.github/workflows/deploy-staging.yml new file mode 100644 index 0000000..5db2171 --- /dev/null +++ b/.github/workflows/deploy-staging.yml @@ -0,0 +1,37 @@ +name: Deploy to staging + +on: + push: + branches: [ "dev" ] + +jobs: + + build: + name: Build image + runs-on: ubuntu-latest + permissions: + id-token: write + contents: read + + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: arn:aws:iam::006874181680:role/gault-github-deploy + aws-region: eu-west-3 + + - name: Login to Amazon ECR + id: login-ecr + uses: aws-actions/amazon-ecr-login@v2 + + - name: Build, tag, and push docker image to Amazon ECR + env: + REGISTRY: ${{ steps.login-ecr.outputs.registry }} + REPOSITORY: gault + IMAGE_TAG: ${{ github.sha }} + run: | + docker build -t $REGISTRY/$REPOSITORY:$IMAGE_TAG . + docker push $REGISTRY/$REPOSITORY:$IMAGE_TAG \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/test.yml similarity index 98% rename from .github/workflows/ci.yml rename to .github/workflows/test.yml index 2fba9f6..dd3fec1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: ci-test +name: Run unit tests on: push: