forked from darobin/notion-backup
-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (45 loc) · 1.59 KB
/
build.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
42
43
44
45
46
47
48
49
50
51
52
name: Build and Deploy image
on:
push:
branches:
- main
workflow_dispatch:
jobs:
publish_n8n_image:
name: Publish n8n image
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Prepare image tag
id: prepare_image_tag
run: |
VERSION_P=$(jq -r .version ./package.json)
N8N_VERSION=$(jq -r .n8nVersion ./package.json)
VERSION="v2-${N8N_VERSION}-${VERSION_P}"
IMAGE="683390223851.dkr.ecr.eu-west-1.amazonaws.com/elp-prod-n8n"
echo ::set-output name=version::${VERSION}
echo ::set-output name=tagged_image::${IMAGE}:${VERSION}
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1
- name: Login to ecr
run: aws ecr get-login-password --region eu-west-1 | docker login --username AWS --password-stdin 683390223851.dkr.ecr.eu-west-1.amazonaws.com
- name: Setup Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
with:
install: true
- name: Publish image
uses: docker/build-push-action@v2
with:
context: .
builder: ${{ steps.buildx.outputs.name }}
file: Dockerfile
target: runner
tags: ${{ steps.prepare_image_tag.outputs.tagged_image }}
build-args: |
VERSION=${{ steps.prepare_image_tag.outputs.version }}
push: true