-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (61 loc) · 1.73 KB
/
build-ruby-image.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
name: "Build Docker Images"
on:
push:
branches:
- 'main'
env:
REGISTRY: ghcr.io
DOCKER_BUILDKIT: 1
COMPOSE_DOCKER_CLI_BUILD: 1
jobs:
build-ruby-image:
runs-on: ubuntu-latest
steps:
- name: Set env
run: >-
echo "TAG=${HEAD_TAG::8}" >> ${GITHUB_ENV};
echo ${HEAD_TAG::8}
env:
HEAD_TAG: ${{ inputs.tag || github.event.pull_request.head.sha || github.sha }}
shell: bash
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout code
uses: actions/checkout@v3
with:
submodules: true
# - name: Install sls
# run: |
# npm install -g serverless
# pushd serverless-ruby-layer
# npm install
# popd
# pushd awslambda
# npm install
# shell: bash
# - name: Package (and buid)
# run: |
# pushd awslambda
# SLS_DEBUG=true sls package
# shell: bash
- name: Build new docker image
run: |
cd awslambda
mkdir .ruby_layer
cd .ruby_layer
cp ../Dockerfile .
cp ../Gemfile* .
cp -r ../derivative_rodeo .
docker build -t ghcr.io/scientist-softserv/space_stone/awsrubylayer:${TAG} .
- name: Push new docker image
run: |
docker push ghcr.io/scientist-softserv/space_stone/awsrubylayer:${TAG}
shell: bash