-
Notifications
You must be signed in to change notification settings - Fork 1
80 lines (69 loc) · 1.97 KB
/
build.yml
File metadata and controls
80 lines (69 loc) · 1.97 KB
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
75
76
77
78
79
80
name: Build
on:
push:
branches: '*'
pull_request:
branches: '*'
workflow_dispatch:
workflow_call:
outputs:
image-tag:
value: ${{ jobs.build-image.outputs.tag }}
env:
NODE_VERSION: 18
REGISTRY: ghcr.io
IMAGE_NAME: object-object/discord-github-utils
jobs:
build-image:
runs-on: ubuntu-latest
outputs:
tag: ${{ fromJson(steps.meta.outputs.json).tags[0] }}
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract image metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build Docker image
id: build
uses: docker/build-push-action@v5
with:
context: .
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
outputs: type=docker,dest=/tmp/image.tar
- name: Upload image artifact
uses: actions/upload-artifact@v4
with:
name: docker-image
path: /tmp/image.tar
retention-days: 7
build-aws-cdk:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: eifinger/setup-rye@v4
with:
enable-cache: true
github-token: ${{ secrets.GITHUB_TOKEN }}
- uses: object-Object/ci/setup@v0
with:
node-version: ${{ env.NODE_VERSION }}
npm-packages: aws-cdk
- name: Sync dependencies
run: rye sync --no-lock --no-dev
- name: Synth aws-cdk stack
run: cdk synth --ci --no-lookups --strict
- name: Upload synth artifact
uses: actions/upload-artifact@v4
with:
name: aws-cdk-synth
path: cdk.out