-
Notifications
You must be signed in to change notification settings - Fork 11
55 lines (48 loc) · 1.43 KB
/
publish-latest.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
name: Publish Docker image for arthur-etl local stage
on:
push:
branches:
- master
- next
release:
types:
- published
jobs:
build-and-push-image:
name: Push Docker image to GitHub Packages
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Log in to the Container registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Build Docker meta information
id: meta
uses: docker/metadata-action@v3
with:
images: ghcr.io/${{ github.repository }}/arthur-etl
# Use the original tag ref, the SHA1, and versions derived from the tag.
tags: |
type=ref,event=tag
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern=v{{version}}
type=sha
- name: Build and push with version tags
id: docker_build
if: ${{ github.event_name == 'release' && github.event.release.tag_name != '' }}
uses: docker/build-push-action@v2
with:
context: .
labels: ${{ steps.meta.outputs.labels }}
push: ${{ github.event.action == 'published' }}
tags: ${{ steps.meta.outputs.tags }}
target: local