-
Notifications
You must be signed in to change notification settings - Fork 0
36 lines (24 loc) · 1.03 KB
/
deploy-to-dev.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
name: Deploy To Development
on: [workflow_dispatch]
jobs:
deploy:
runs-on: ubuntu-latest
env:
DOCKER_REPO: ${{ secrets.DEPLOY_DOCKER_REPOSITORY }}
environment: development
steps:
- uses: actions/checkout@v4
- id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- uses: aws-actions/configure-aws-credentials@v1-node16
with:
aws-access-key-id: ${{ secrets.DEPLOY_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.DEPLOY_AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-2
- uses: aws-actions/amazon-ecr-login@v1
- run: docker pull $DOCKER_REPO:latest || echo "no current latest image"
- run: docker build -t $DOCKER_REPO:${{ steps.vars.outputs.sha_short }} .
working-directory: ./task
- run: docker tag $DOCKER_REPO:${{ steps.vars.outputs.sha_short }} $DOCKER_REPO:latest
- run: docker push $DOCKER_REPO:${{ steps.vars.outputs.sha_short }}
- run: docker push $DOCKER_REPO:latest