-
Notifications
You must be signed in to change notification settings - Fork 61
64 lines (50 loc) · 1.8 KB
/
builder-docker-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
63
64
# Build 'nextstrain/nextclade_builder' docker image and push it to DockerHub
name: builder-docker-image
on:
repository_dispatch:
types: build
workflow_dispatch:
workflow_call:
concurrency:
group: builder-docker-image-${{ github.workflow }}-${{ github.ref_type }}-${{ github.event.pull_request.number || github.ref || github.run_id }}
cancel-in-progress: true
defaults:
run:
shell: bash -euxo pipefail {0}
env:
GITHUB_REPOSITORY_URL: ${{ github.server_url }}/${{ github.repository }}
VERBOSE: 1
jobs:
build-base-image:
name: "Build base image"
runs-on: ubuntu-22.04
steps:
- name: "Set up Docker Buildx"
uses: docker/setup-buildx-action@v3
- name: "Checkout code"
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: true
- name: "Login to Docker Hub"
uses: docker/login-action@v3
with:
registry: docker.io
username: nextstrainbot
password: ${{ secrets.DOCKER_TOKEN }}
- name: "Get docker build checksum"
id: docker-build-checksum
run: echo "checksum=$(./scripts/docker_build_checksum.sh)" >> $GITHUB_OUTPUT
- name: "Setup cache for Docker buildx"
uses: actions/cache@v4
with:
path: .cache/docker/buildx
key: cache-v1-buildx-${{ runner.os }}-${{ steps.docker-build-checksum.outputs.checksum }}
restore-keys: |
cache-v1-buildx-${{ runner.os }}-${{ steps.docker-build-checksum.outputs.checksum }}
cache-v1-buildx-${{ runner.os }}-
- name: "Build image: base"
run: |
cp .env.example .env
sed -i -e "s|OSXCROSS_URL=http://example.com/osxcross/osxcross.tar.xz|OSXCROSS_URL=${{ secrets.OSXCROSS_URL }}|g" .env
./docker/dev docker-image-build-push