-
Notifications
You must be signed in to change notification settings - Fork 26
88 lines (74 loc) · 2.44 KB
/
starship-docker.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Starship Docker
on:
push:
branches:
- main
- release/*
paths:
- "starship/registry/**"
- "starship/exposer/**"
- "starship/faucet/**"
- ".github/workflows/starship-docker.yaml"
pull_request:
branches:
- main
paths:
- "starship/registry/**"
- "starship/exposer/**"
- "starship/faucet/**"
- ".github/workflows/starship-docker.yaml"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-starship-docker
cancel-in-progress: true
jobs:
deploy-docker:
runs-on: ubuntu-latest
permissions:
packages: write
strategy:
matrix:
type: [ "registry", "exposer", "faucet" ]
fail-fast: false
defaults:
run:
working-directory: starship
env:
DOCKER_REPO: ghcr.io/cosmology-tech/starship
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
src:
- 'starship/${{ matrix.type }}/**'
- name: Set up QEMU
if: steps.changes.outputs.src == 'true' || github.event_name == 'workflow_dispatch'
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
if: steps.changes.outputs.src == 'true' || github.event_name == 'workflow_dispatch'
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
if: steps.changes.outputs.src == 'true' || github.event_name == 'workflow_dispatch'
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Determine tag
if: steps.changes.outputs.src == 'true' || github.event_name == 'workflow_dispatch'
id: docker-tag
run: |
tag=$(date -u "+%Y%m%d")-$(echo ${GITHUB_SHA} | cut -c1-7)
echo Tag will be $tag
echo ::set-output name=version::$tag
- name: Build and push
if: steps.changes.outputs.src == 'true' || github.event_name == 'workflow_dispatch'
uses: docker/build-push-action@v4
with:
push: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
context: starship/${{ matrix.type }}/
tags: ghcr.io/cosmology-tech/starship/${{ matrix.type }}:${{ steps.docker-tag.outputs.version }}
platforms: linux/amd64,linux/arm64