This repository has been archived by the owner on Sep 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
74 lines (66 loc) · 2.14 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Build / Test / Push
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
step: ['lint:check', 'build']
steps:
- uses: actions/checkout@v4
- name: Setup yarn
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: 'yarn'
- run: yarn --immutable --immutable-cache
- run: yarn
- run: yarn ${{ matrix.step }}
push:
needs: [build]
if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
checks: write
packages: write
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Setup Docker buildx
uses: docker/setup-buildx-action@v2
- name: Log in to the GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push container image to GitHub Container Registry
uses: docker/build-push-action@v4
with:
push: true
platforms: linux/amd64,linux/arm64
# TODO: add build version node args
tags: |
ghcr.io/ar-io/arns-resolver:${{ github.sha }}
ghcr.io/ar-io/arns-resolver:latest
# deploy:
# if: github.ref == 'refs/heads/main'
# needs: [build, push]
# runs-on: ubuntu-latest
# permissions:
# id-token: write
# contents: read
# environment: production
# steps:
# - uses: actions/checkout@v3
# - name: Configure AWS credentials
# uses: aws-actions/configure-aws-credentials@v4
# with:
# role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ secrets.AWS_DEPLOYMENT_ROLE }}
# aws-region: ${{ secrets.AWS_REGION }}
# - name: Update Service
# run: |
# aws ecs update-service --cluster ${{ secrets.AWS_CLUSTER }} --service ${{ secrets.AWS_SERVICE }} --force-new-deployment --region ${{ secrets.AWS_REGION }}