-
Notifications
You must be signed in to change notification settings - Fork 1
41 lines (39 loc) · 1.19 KB
/
deploy.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
37
38
39
40
41
name: Deploy
run-name: Deploy to ${{ inputs.environment }} by @${{ github.actor }}
on:
workflow_call:
inputs:
environment:
description: What environment should the app be deployed to?
required: true
default: 'development'
type: string
secrets:
DEPLOY_DOCKER_REPOSITORY:
required: true
DEPLOY_AWS_ACCESS_KEY_ID:
required: true
DEPLOY_AWS_SECRET_ACCESS_KEY:
required: true
jobs:
deploy:
runs-on: ubuntu-latest
environment: ${{ inputs.environment }}
env:
DOCKER_REPO: ${{ secrets.DEPLOY_DOCKER_REPOSITORY }}
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: '22.5.1'
- name: Install node dependencies
run: npm ci
- uses: aws-actions/configure-aws-credentials@v4
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@v2
- name: Build & Push Docker images
uses: ./.github/actions/build-and-push