-
Notifications
You must be signed in to change notification settings - Fork 78
61 lines (58 loc) · 1.89 KB
/
ci.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
name: CI
on:
push:
# Avoid duplicate builds on PRs.
branches:
- main
tags:
- v*
pull_request:
permissions:
contents: read
jobs:
shellcheck:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run shellcheck
run: find . -type f \( -name "*.sh" -o -path "*/bin/*" \) ! -name '*.jq' | xargs -t shellcheck
build-stack:
runs-on: ubuntu-22.04
needs:
- shellcheck
env:
STACK: heroku-${{ matrix.stack-version }}
STACK_VERSION: "${{ matrix.stack-version }}"
DOCKER_HUB_TOKEN: "${{ secrets.DOCKER_HUB_TOKEN }}"
DOCKER_HUB_USERNAME: "${{ secrets.DOCKER_HUB_USERNAME }}"
MANIFEST_APP_TOKEN: "${{ secrets.MANIFEST_APP_TOKEN }}"
MANIFEST_APP_URL: "${{ secrets.MANIFEST_APP_URL }}"
strategy:
fail-fast: false
matrix:
stack-version: ["20", "22", "24"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build images
run: bin/build.sh $STACK_VERSION
- name: Check that the generated files are in sync
run: |-
status="$(git status --porcelain)"
if [[ -n "$status" ]]; then
echo "Generated files differ from checked-in versions! Run bin/build.sh to regenerate them locally."
echo -e "\nChanged files:\n${status}\n"
git diff
exit 1
fi
- name: Publish to image registries
run: |-
docker buildx create --use
bin/publish-to-registries.sh
if: success() && (github.ref_name == 'main' || github.ref_type == 'tag')
- name: Unpublish temp tags from this run
run: bin/unpublish-tags.sh
if: always() && (github.ref_name == 'main' || github.ref_type == 'tag')
- name: Convert docker image and for Git tags release to Heroku staging
run: bin/convert-and-publish-to-heroku.sh