-
Notifications
You must be signed in to change notification settings - Fork 4
57 lines (53 loc) · 1.5 KB
/
docker.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
on:
release:
types:
- published
push:
branches:
- main
pull_request:
types:
- opened
- synchronize
- reopened
branches-ignore:
- "dependabot/**"
name: "Docker"
jobs:
docker:
name: "Publish"
runs-on: ubuntu-latest
env:
VERSION: "${{ github.event_name == 'release' && github.event.release.name || github.ref_name }}"
steps:
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
id: login
env:
token_is_present: "${{ secrets.FLYIOBUILDS_DOCKERHUB_TOKEN && true }}"
if: ${{ env.token_is_present }}
with:
username: ${{ secrets.FLYIOBUILDS_DOCKERHUB_USERNAME }}
password: ${{ secrets.FLYIOBUILDS_DOCKERHUB_TOKEN }}
- id: meta
uses: docker/metadata-action@v5
with:
images: flyio/fly-autoscaler
tags: |
type=ref,event=branch
type=ref,event=pr
type=sha
type=sha,format=long
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- uses: docker/build-push-action@v5
with:
context: .
push: ${{ steps.login.outcome != 'skipped' }}
platforms: "linux/amd64"
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
FAS_VERSION=${{ env.VERSION }}
FAS_COMMIT=${{ github.sha }}