generated from PaulRBerg/hardhat-template
-
Notifications
You must be signed in to change notification settings - Fork 4
56 lines (47 loc) · 1.3 KB
/
ecs-deployment.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
53
54
55
56
name: Build and Deploy Ciphernode
on:
push:
branches:
- main
paths:
- 'packages/ciphernode/**'
- 'packages/evm/contracts/**'
pull_request:
branches:
- main
paths:
- 'packages/ciphernode/**'
- 'packages/evm/contracts/**'
env:
DOCKERFILE_PATH: packages/ciphernode/Dockerfile
IMAGE_NAME: ghcr.io/gnosisguild/ciphernode
permissions:
contents: read
packages: write
jobs:
deploy:
name: Deploy to GHCR
runs-on: ubuntu-latest
environment: production
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build, tag, and push image to GHCR
id: build-image
env:
IMAGE_TAG: ${{ github.sha }}
run: |
# Build the image
docker build -t $IMAGE_NAME:$IMAGE_TAG -t $IMAGE_NAME:latest -f $DOCKERFILE_PATH .
# Push both tagged and latest images
docker push $IMAGE_NAME:$IMAGE_TAG
docker push $IMAGE_NAME:latest
# Output image details
echo "image=$IMAGE_NAME:$IMAGE_TAG" >> $GITHUB_OUTPUT
echo "image=$IMAGE_NAME:latest" >> $GITHUB_OUTPUT