-
Notifications
You must be signed in to change notification settings - Fork 20
72 lines (59 loc) · 1.85 KB
/
on_pull_request.yaml
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
name: pr_build
on:
pull_request:
paths:
- '*'
- '*/**'
- '!README.md'
- '!COPYING.LGPL-3'
- '!.gitattributes'
- '!.gitignore'
env:
FS_IMAGE: ttl.sh/${{ github.repository }}/pr-${{ github.event.pull_request.number }}/${{ github.event.pull_request.head.sha }}
FS_TAG: 24h
# TODO: Move this to repo config
jobs:
build:
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
pull-requests: write
strategy:
matrix:
platform:
- linux/amd64
# - linux/arm64
steps:
- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v1
with:
image: tonistiigi/binfmt:latest
platforms: all
if: matrix.platform == 'linux/arm64'
- uses: actions/checkout@v3
- name: extract git sha
run: echo "GIT_SHA_SHORT=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
# Reads in .tools-versions and spits out env variables
- uses: wistia/[email protected]
- uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: earthly/actions-setup@v1
with: { version: "v${{ env.EARTHLY_TOOL_VERSION }}" }
- run: |
earthly \
--push \
--platform ${{ matrix.platform }} \
+docker-tag \
--GIT_COMMIT=${{ env.GIT_SHA_SHORT }} \
--GIT_TAG=${{ env.FS_TAG }} \
--GOLANG_VERSION=${{ env.GOLANG_TOOL_VERSION }} \
--CI_REGISTRY_IMAGE=${{ env.FS_IMAGE }}
- uses: mshick/add-pr-comment@v2
with:
message: |
Temporary image available at `${{ env.FS_IMAGE }}:${{ env.FS_TAG }}` for 24 hours. If you need another built, close and reopen the PR.