-
Notifications
You must be signed in to change notification settings - Fork 4
34 lines (27 loc) · 1.09 KB
/
push.yml
File metadata and controls
34 lines (27 loc) · 1.09 KB
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
name: Push Image
on:
release:
types: [published]
jobs:
build_image:
name: Build Lighthouse Image
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
- name: Build image
run: DOCKER_BUILDKIT=1 docker build -t ghcr.io/wanteddev/lighthouse:${{github.event.release.tag_name}} --build-arg BUILDKIT_INLINE_CACHE=1 --cache-from ghcr.io/wanteddev/lighthouse:latest .
- name: Push image
run: docker push ghcr.io/wanteddev/lighthouse:${{github.event.release.tag_name}}
- name: Update latest image (to be used in caching)
run: |
docker tag ghcr.io/wanteddev/lighthouse:${{github.event.release.tag_name}} ghcr.io/wanteddev/lighthouse:latest
docker push ghcr.io/wanteddev/lighthouse:latest
if: "github.event.release.prerelease != true"