forked from rubygems/rubygems.org
-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (49 loc) · 1.66 KB
/
docker.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
name: Docker
on:
pull_request:
push:
branches:
- master
- webauthn-cli
permissions:
contents: read
id-token: write
jobs:
build:
name: Docker build (and optional push)
runs-on: ubuntu-22.04
env:
RUBYGEMS_VERSION: 3.4.12
RUBY_VERSION: 3.2.2
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@4b4e9c3e2d4531116a6f8ba8e71fc6e2cb6e6c8c # master
- name: Cache Docker layers
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-rubygems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-rubygems-org
- name: Install and start services (needed for image test)
run: docker-compose up -d
- name: Configure AWS credentials from Production account
uses: aws-actions/configure-aws-credentials@v2
if: github.secret_source != 'None'
with:
role-to-assume: arn:aws:iam::048268392960:role/rubygems-ecr-pusher
aws-region: us-west-2
- name: Login to Amazon ECR
if: github.secret_source != 'None'
uses: aws-actions/amazon-ecr-login@v1
- name: build, test and optionally push docker image
run: ./script/build_docker.sh
# Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache